[TASK] Remove the dependency of EXT:tstemplate to EXT:frontend 50/53550/2
authorGeorg Ringer <georg.ringer@gmail.com>
Sun, 16 Jul 2017 10:37:00 +0000 (12:37 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 19 Jul 2017 18:34:38 +0000 (20:34 +0200)
Use the RootlineUtility directly in EXT:tstemplate to get
the rootline instead of using EXT:frontend which then
calls the RootlineUtility.

Resolves: #81889
Releases: master, 8.7
Change-Id: I66153204db4e1b67bf0a80efe1c5d2c73ce585fa
Reviewed-on: https://review.typo3.org/53550
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateConstantEditorModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php

index d225a88..dc63c0f 100644 (file)
@@ -18,8 +18,8 @@ use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\RootlineUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
-use TYPO3\CMS\Frontend\Page\PageRepository;
 
 /**
  * TypoScript template analyzer
@@ -91,8 +91,8 @@ class TemplateAnalyzerModuleFunctionController extends AbstractFunctionModule
         $this->templateService->init();
 
         // Gets the rootLine
-        $sys_page = GeneralUtility::makeInstance(PageRepository::class);
-        $rootLine = $sys_page->getRootLine($pageId);
+        $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
+        $rootLine = $rootlineUtility->get();
 
         // This generates the constants/config + hierarchy info for the template.
         $this->templateService->runThroughTemplates($rootLine, $templateUid);
index 522c15a..a1edcfe 100644 (file)
@@ -19,8 +19,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\RootlineUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
-use TYPO3\CMS\Frontend\Page\PageRepository;
 
 /**
  * TypoScript Constant editor
@@ -68,8 +68,8 @@ class TypoScriptTemplateConstantEditorModuleFunctionController extends AbstractF
         // IF there was a template...
         if (is_array($this->templateRow)) {
             // Gets the rootLine
-            $sys_page = GeneralUtility::makeInstance(PageRepository::class);
-            $rootLine = $sys_page->getRootLine($pageId);
+            $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
+            $rootLine = $rootlineUtility->get();
             // This generates the constants/config + hierarchy info for the template.
             $this->templateService->runThroughTemplates($rootLine, $template_uid);
             // The editable constants are returned in an array.
index 7f9dd17..52684c4 100644 (file)
@@ -22,8 +22,8 @@ use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\RootlineUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
-use TYPO3\CMS\Frontend\Page\PageRepository;
 
 /**
  * This class displays the submodule "TypoScript Object Browser" inside the Web > Template module
@@ -131,8 +131,8 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
         $this->templateService->init();
 
         // Gets the rootLine
-        $sys_page = GeneralUtility::makeInstance(PageRepository::class);
-        $rootLine = $sys_page->getRootLine($pageId);
+        $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
+        $rootLine = $rootlineUtility->get();
         // This generates the constants/config + hierarchy info for the template.
         $this->templateService->runThroughTemplates($rootLine, $template_uid);