[BUGFIX] Fix regressions and leftovers in Context API 96/57396/12
authorBenni Mack <benni@typo3.org>
Wed, 27 Jun 2018 13:31:53 +0000 (15:31 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 1 Jul 2018 15:47:32 +0000 (17:47 +0200)
Some usages where now-deprecated properties are used,
have been adjusted.

The RST file has been enhanced to clarify when to clone
the context, and when to override an aspect.

Additionally, the usage within TemplateService has been
optimized to also receive an optional context object,
similar to the initial patch's PageRepository approach.

Resolves: #85408
Related: #85389
Releases: master
Change-Id: I178ff07cbfe999a90bf7d5dd4f20a6170876d003
Reviewed-on: https://review.typo3.org/57396
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
21 files changed:
typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php
typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php
typo3/sysext/core/Classes/Context/Context.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85408-TemplateServiceInitDeprecated.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Feature-85389-ContextAPIForConsistentDataHandling.rst
typo3/sysext/core/Tests/Unit/TypoScript/TemplateServiceTest.php
typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php
typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Tests/Unit/ContentObject/CaseContentObjectTest.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php
typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateConstantEditorModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php

index e1c7612..b430d48 100644 (file)
@@ -201,7 +201,7 @@ class PreviewModule extends AbstractModule
             }
             $context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $tsfe->fe_user));
         }
-        if (!$tsfe->simUserGroup && !$simTime && !$tsfe->showHiddenPage && !$tsfe->showHiddenRecords) {
+        if (!$tsfe->simUserGroup && !$simTime && !$showHiddenPage && !$showHiddenRecords) {
             $tsfe->fePreview = 0;
         }
     }
index 0afc7e6..d868567 100644 (file)
@@ -90,6 +90,6 @@ class BackendUserAuthenticator implements MiddlewareInterface
     protected function setBackendUserAspect(Context $context, BackendUserAuthentication $user)
     {
         $context->setAspect('backend.user', GeneralUtility::makeInstance(UserAspect::class, $user));
-        $context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $user ? $user->workspace : 0));
+        $context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $user->workspace));
     }
 }
index d67f9fa..4f9da7a 100644 (file)
@@ -108,11 +108,11 @@ class Context implements SingletonInterface
     }
 
     /**
-     * Returns a propert yfrom the aspect, but only if the property is found.
+     * Returns a propertfrom the aspect, but only if the property is found.
      *
      * @param string $name
      * @param string $property
-     * @param null $default
+     * @param mixed $default
      * @return mixed|null
      * @throws AspectNotFoundException
      */
index b4ecf84..62e7fe4 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\TypoScript;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
+use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -357,6 +358,42 @@ class TemplateService
     protected $queryBuilderRestrictions;
 
     /**
+     * @var Context
+     */
+    protected $context;
+
+    /**
+     * @param Context|null $context
+     */
+    public function __construct(Context $context = null)
+    {
+        $this->context = $context ?? GeneralUtility::makeInstance(Context::class);
+        $this->initializeDatabaseQueryRestrictions();
+        if ($this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false) || $GLOBALS['SIM_ACCESS_TIME'] !== $GLOBALS['ACCESS_TIME']) {
+            // Set the simulation flag, if simulation is detected!
+            $this->simulationHiddenOrTime = 1;
+        }
+
+        // Sets the paths from where TypoScript resources are allowed to be used:
+        $this->allowedPaths = [
+            $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'],
+            // fileadmin/ path
+            'uploads/',
+            'typo3temp/',
+            TYPO3_mainDir . 'ext/',
+            TYPO3_mainDir . 'sysext/',
+            'typo3conf/ext/'
+        ];
+        if ($GLOBALS['TYPO3_CONF_VARS']['FE']['addAllowedPaths']) {
+            $pathArr = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['addAllowedPaths'], true);
+            foreach ($pathArr as $p) {
+                // Once checked for path, but as this may run from typo3/mod/web/ts/ dir, that'll not work!! So the paths ar uncritically included here.
+                $this->allowedPaths[] = $p;
+            }
+        }
+    }
+
+    /**
      * @return bool
      */
     public function getProcessExtensionStatics()
@@ -383,15 +420,14 @@ class TemplateService
 
     /**
      * Initialize
-     * MUST be called directly after creating a new template-object
      *
-     * @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::initTemplate()
+     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10
      */
     public function init()
     {
+        trigger_error('Method will be removed in TYPO3 v10, __construct() does the job', E_USER_DEPRECATED);
         $this->initializeDatabaseQueryRestrictions();
-
-        if ($this->getTypoScriptFrontendController()->showHiddenRecords || $GLOBALS['SIM_ACCESS_TIME'] !== $GLOBALS['ACCESS_TIME']) {
+        if ($this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false) || $GLOBALS['SIM_ACCESS_TIME'] !== $GLOBALS['ACCESS_TIME']) {
             // Set the simulation flag, if simulation is detected!
             $this->simulationHiddenOrTime = 1;
         }
@@ -420,10 +456,11 @@ class TemplateService
      */
     protected function initializeDatabaseQueryRestrictions()
     {
+        $includeHiddenRecords = $this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false);
         // $this->whereClause is used only to select templates from sys_template.
         // $GLOBALS['SIM_ACCESS_TIME'] is used so that we're able to simulate a later time as a test...
         $this->whereClause = 'AND deleted=0 ';
-        if (!$this->getTypoScriptFrontendController()->showHiddenRecords) {
+        if (!$includeHiddenRecords) {
             $this->whereClause .= 'AND hidden=0 ';
         }
         $this->whereClause .= 'AND (starttime<=' . $GLOBALS['SIM_ACCESS_TIME'] . ') AND (endtime=0 OR endtime>' . $GLOBALS['SIM_ACCESS_TIME'] . ')';
@@ -431,9 +468,8 @@ class TemplateService
         // set up the query builder restrictions
         $this->queryBuilderRestrictions = GeneralUtility::makeInstance(DefaultRestrictionContainer::class);
 
-        if ($this->getTypoScriptFrontendController()->showHiddenRecords) {
-            $this->queryBuilderRestrictions
-                ->removeByType(HiddenRestriction::class);
+        if ($includeHiddenRecords) {
+            $this->queryBuilderRestrictions->removeByType(HiddenRestriction::class);
         }
     }
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85408-TemplateServiceInitDeprecated.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85408-TemplateServiceInitDeprecated.rst
new file mode 100644 (file)
index 0000000..40dcb2e
--- /dev/null
@@ -0,0 +1,34 @@
+.. include:: ../../Includes.txt
+
+=======================================================
+Deprecation: #85408 - TemplateService init() deprecated
+=======================================================
+
+See :issue:`85408`
+
+Description
+===========
+
+Method :php:`TYPO3\CMS\Core\TypoScript\TemplateService->init()` has been deprecated
+and should not be used any longer.
+
+Impact
+======
+
+Calling above method triggers a deprecation log entry.
+
+
+Affected Installations
+======================
+
+Instances with extensions calling the above method. However, the extension scanner
+is not configured to find this too generic method name.
+
+
+Migration
+=========
+
+The business code of the method is done within :php:`__construct()`, an explicit call
+to :php:`init()` is no longer needed and can be removed.
+
+.. index:: PHP-API, NotScanned
\ No newline at end of file
index eb2e799..14773f0 100644 (file)
@@ -88,7 +88,9 @@ It is recommended to read data from the current global Context for custom extens
     $userIsLoggedIn = $context->getPropertyFromAspect('frontend.user', 'isLoggedIn');
 
 
-Additionally, if custom DB queries need to be made, this can be solved via cloning the Context API
+If an aspect needs to be added, or a middleware replaces an aspect, the main context object can be altered.
+
+However, if custom DB queries need to be made, it is strongly recommended to clone the context object:
 
 .. code-block:: php
 
@@ -102,6 +104,13 @@ Additionally, if custom DB queries need to be made, this can be solved via cloni
     $pageRow = $sysPage->getPage($pageId);
 
 
+As a rule of thumb:
+- If new code is written that is depending on external factors for querying data, ensure that a context object
+can be handed in via e.g. the constructor.
+- If you are sure, that the consuming class is NOT altering the context object, the main context object can be used
+- If the consuming class, e.g. ContentObjectRenderer is altering the context object, it is recommended to hand in a clone
+of a context.
+
 Further development
 ===================
 
index e81bf52..b756361 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\TypoScript;
  */
 
 use Prophecy\Argument;
+use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
 use TYPO3\CMS\Core\Package\Package;
@@ -55,11 +56,14 @@ class TemplateServiceTest extends UnitTestCase
     protected function setUp(): void
     {
         $GLOBALS['TYPO3_LOADED_EXT'] = [];
-        $this->templateService = new TemplateService();
+        $GLOBALS['SIM_ACCESS_TIME'] = time();
+        $GLOBALS['ACCESS_TIME'] = time();
+        $this->templateService = new TemplateService(new Context());
         $this->templateService->tt_track = false;
         $this->templateServiceMock = $this->getAccessibleMock(
             TemplateService::class,
-            ['dummy']
+            ['dummy'],
+            [new Context()]
         );
         $this->templateServiceMock->tt_track = false;
         $this->backupPackageManager = ExtensionManagementUtilityAccessibleProxy::getPackageManager();
@@ -226,7 +230,7 @@ class TemplateServiceTest extends UnitTestCase
      */
     public function getFileNameReturnsNullIfDirectory(): void
     {
-        $this->assertNull($this->templateService->getFileName(__DIR__));
+        $this->assertNull($this->templateService->getFileName('typo3/'));
     }
 
     /**
index 3f4b3fb..7780a3b 100644 (file)
@@ -58,7 +58,6 @@ class BackendConfigurationManager extends AbstractConfigurationManager
             $template->tt_track = 0;
             // Explicitly trigger processing of extension static files
             $template->setProcessExtensionStatics(true);
-            $template->init();
             // Get the root line
             $rootline = [];
             if ($pageId > 0) {
index 6b2f35a..6247af1 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Form\Domain\Runtime;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -37,7 +38,7 @@ use TYPO3\CMS\Form\Domain\Renderer\RendererInterface;
 use TYPO3\CMS\Form\Domain\Runtime\Exception\PropertyMappingException;
 use TYPO3\CMS\Form\Exception as FormException;
 use TYPO3\CMS\Form\Mvc\Validation\EmptyValidator;
-use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
+use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
 
 /**
  * This class implements the *runtime logic* of a form, i.e. deciding which
@@ -351,13 +352,13 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
      */
     protected function getHoneypotNameFromSession(Page $page)
     {
-        if ($this->getTypoScriptFrontendController()->loginUser) {
-            $honeypotNameFromSession = $this->getTypoScriptFrontendController()->fe_user->getKey(
+        if ($this->isFrontendUserAuthenticated()) {
+            $honeypotNameFromSession = $this->getFrontendUser()->getKey(
                 'user',
                 self::HONEYPOT_NAME_SESSION_IDENTIFIER . $this->getIdentifier() . $page->getIdentifier()
             );
         } else {
-            $honeypotNameFromSession = $this->getTypoScriptFrontendController()->fe_user->getKey(
+            $honeypotNameFromSession = $this->getFrontendUser()->getKey(
                 'ses',
                 self::HONEYPOT_NAME_SESSION_IDENTIFIER . $this->getIdentifier() . $page->getIdentifier()
             );
@@ -371,14 +372,14 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
      */
     protected function setHoneypotNameInSession(Page $page, string $honeypotName)
     {
-        if ($this->getTypoScriptFrontendController()->loginUser) {
-            $this->getTypoScriptFrontendController()->fe_user->setKey(
+        if ($this->isFrontendUserAuthenticated()) {
+            $this->getFrontendUser()->setKey(
                 'user',
                 self::HONEYPOT_NAME_SESSION_IDENTIFIER . $this->getIdentifier() . $page->getIdentifier(),
                 $honeypotName
             );
         } else {
-            $this->getTypoScriptFrontendController()->fe_user->setKey(
+            $this->getFrontendUser()->setKey(
                 'ses',
                 self::HONEYPOT_NAME_SESSION_IDENTIFIER . $this->getIdentifier() . $page->getIdentifier(),
                 $honeypotName
@@ -387,6 +388,17 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
     }
 
     /**
+     * Necessary to know if honeypot information should be stored in the user session info, or in the anonymous session
+     *
+     * @return bool true when a frontend user is logged, otherwise false
+     */
+    protected function isFrontendUserAuthenticated(): bool
+    {
+        return (bool)GeneralUtility::makeInstance(Context::class)
+            ->getPropertyFromAspect('frontend.user', 'isLoggedIn', false);
+    }
+
+    /**
      * Returns TRUE if the last page of the form has been submitted, otherwise FALSE
      *
      * @return bool
@@ -922,10 +934,10 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
     }
 
     /**
-     * @return TypoScriptFrontendController
+     * @return FrontendUserAuthentication
      */
-    protected function getTypoScriptFrontendController()
+    protected function getFrontendUser(): FrontendUserAuthentication
     {
-        return $GLOBALS['TSFE'];
+        return $GLOBALS['TSFE']->fe_user;
     }
 }
index 1f338de..f70e64c 100644 (file)
@@ -953,7 +953,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     {
         $userGroups = [0];
         // This affects the hidden-flag selecting the fe_groups for the user!
-        $this->fe_user->showHiddenRecords = $this->showHiddenRecords;
+        $this->fe_user->showHiddenRecords = $this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false);
         // no matter if we have an active user we try to fetch matching groups which can be set without an user (simulation for instance!)
         $this->fe_user->fetchGroupData();
         $isUserAndGroupSet = is_array($this->fe_user->user) && !empty($this->fe_user->groupData['uid']);
@@ -1035,7 +1035,11 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     public function clear_preview()
     {
-        if ($this->fePreview || $GLOBALS['EXEC_TIME'] !== $GLOBALS['SIM_EXEC_TIME'] || $this->showHiddenPage || $this->showHiddenRecords) {
+        if ($this->fePreview
+            || $GLOBALS['EXEC_TIME'] !== $GLOBALS['SIM_EXEC_TIME']
+            || $this->context->getPropertyFromAspect('visibility', 'includeHiddenPages', false)
+            || $this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false)
+        ) {
             $this->showHiddenPage = false;
             $this->showHiddenRecords = false;
             $GLOBALS['SIM_EXEC_TIME'] = $GLOBALS['EXEC_TIME'];
@@ -2231,9 +2235,8 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     public function initTemplate()
     {
-        $this->tmpl = GeneralUtility::makeInstance(TemplateService::class);
+        $this->tmpl = GeneralUtility::makeInstance(TemplateService::class, $this->context);
         $this->tmpl->setVerbose($this->isBackendUserLoggedIn());
-        $this->tmpl->init();
         $this->tmpl->tt_track = $this->isBackendUserLoggedIn();
     }
 
index 8dc70fb..a290545 100644 (file)
@@ -113,11 +113,11 @@ class BackendUserAuthenticator implements MiddlewareInterface
      * Register the backend user as aspect
      *
      * @param Context $context
-     * @param BackendUserAuthentication $user
+     * @param BackendUserAuthentication|null $user
      */
     protected function setBackendUserAspect(Context $context, BackendUserAuthentication $user)
     {
         $context->setAspect('backend.user', GeneralUtility::makeInstance(UserAspect::class, $user));
-        $context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $user ? $user->workspace : 0));
+        $context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $user->workspace));
     }
 }
index 5e32a63..f66aadf 100644 (file)
@@ -123,6 +123,6 @@ class FrontendUserAuthenticator implements MiddlewareInterface
      */
     protected function setFrontendUserAspect(Context $context, AbstractUserAuthentication $user)
     {
-        $context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $user, $user === null ? [0, -1] : null));
+        $context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $user));
     }
 }
index 2501948..ecfb6f0 100644 (file)
@@ -1993,14 +1993,6 @@ class PageRepository implements LoggerAwareInterface
     }
 
     /**
-     * @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
-     */
-    protected function getTypoScriptFrontendController()
-    {
-        return $GLOBALS['TSFE'];
-    }
-
-    /**
      * Returns the current BE user.
      *
      * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
index a9742e7..e7c4232 100644 (file)
@@ -51,6 +51,7 @@ class CaseContentObjectTest extends UnitTestCase
             ->getMock();
         $tsfe->tmpl = $this->getMockBuilder(TemplateService::class)
             ->setMethods(['dummy'])
+            ->disableOriginalConstructor()
             ->getMock();
         $tsfe->config = [];
         $tsfe->page = [];
index 26b4a79..d254f7a 100644 (file)
@@ -689,7 +689,6 @@ class CrawlerHook
     public function getUidRootLineForClosestTemplate($id)
     {
         $tmpl = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::class);
-        $tmpl->init();
         // Gets the rootLine
         $sys_page = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
         $rootLine = $sys_page->getRootLine($id);
index b10bf7c..7fa7711 100644 (file)
@@ -59,7 +59,6 @@ class CodeCompletionController
     protected function getMergedTemplates($pageId)
     {
         $tsParser = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $tsParser->init();
         // Gets the rootLine
         $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pageId)->get();
         // This generates the constants/config + hierarchy info for the template.
index 1b3c303..01496bb 100644 (file)
@@ -88,7 +88,6 @@ class TemplateAnalyzerModuleFunctionController extends AbstractFunctionModule
     {
         // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
         $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $this->templateService->init();
 
         // Gets the rootLine
         $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
index 9ed409f..dfb6a0c 100644 (file)
@@ -61,7 +61,6 @@ class TypoScriptTemplateConstantEditorModuleFunctionController extends AbstractF
     public function initialize_editor($pageId, $template_uid = 0)
     {
         $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $this->templateService->init();
 
         // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
         $this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid);
index 87db910..272aad1 100644 (file)
@@ -96,7 +96,6 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
     public function initialize_editor($pageId, $template_uid = 0)
     {
         $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $this->templateService->init();
 
         // Get the row of the first VISIBLE template of the page. where clause like the frontend.
         $this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid);
index f00ec2c..92c57c0 100644 (file)
@@ -405,7 +405,6 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
     public function noTemplate($newStandardTemplate = 0)
     {
         $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $this->templateService->init();
 
         $moduleContent['state'] = InfoboxViewHelper::STATE_INFO;
 
@@ -456,7 +455,6 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
     public function templateMenu()
     {
         $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $this->templateService->init();
 
         $all = $this->templateService->ext_getAllTemplates($this->id);
         if (count($all) > 1) {
index e556f6c..0591021 100644 (file)
@@ -128,7 +128,6 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
     {
         // Defined global here!
         $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
-        $this->templateService->init();
 
         // Gets the rootLine
         $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);