[BUGFIX] setPartialRootPaths in the backend tabs menu 48/50948/4
authorAlexander Opitz <opitz.alexander@googlemail.com>
Tue, 13 Dec 2016 09:16:43 +0000 (10:16 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 20 Dec 2016 12:17:43 +0000 (13:17 +0100)
Adding the root paths to the partials, which aren't autoguessed anymore.

Resolves: #78969
Releases: master
Change-Id: I578fd21ed0b232198301f73c702569980ed82906
Reviewed-on: https://review.typo3.org/50948
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/backend/Classes/Form/Container/AbstractContainer.php
typo3/sysext/backend/Classes/Template/ModuleTemplate.php

index 04c2a83..b105f1d 100644 (file)
@@ -19,6 +19,7 @@ use TYPO3\CMS\Backend\Form\NodeFactory;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 
@@ -80,9 +81,12 @@ abstract class AbstractContainer extends AbstractNode
      */
     protected function renderTabMenu(array $menuItems, $domId, $defaultTabIndex = 1)
     {
-        $templatePathAndFileName = 'EXT:backend/Resources/Private/Templates/DocumentTemplate/Tabs.html';
+        $templatePath = ExtensionManagementUtility::extPath('backend')
+            . 'Resources/Private/Templates/DocumentTemplate/';
+
         $view = GeneralUtility::makeInstance(StandaloneView::class);
-        $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templatePathAndFileName));
+        $view->setTemplatePathAndFilename($templatePath . 'Tabs.html');
+        $view->setPartialRootPaths([$templatePath . 'Partials']);
         $view->assignMultiple([
             'id' => $domId,
             'items' => $menuItems,
index 549f8e3..45d6fdd 100644 (file)
@@ -446,9 +446,11 @@ class ModuleTemplate
     public function getDynamicTabMenu(array $menuItems, $domId, $defaultTabIndex = 1, $collapsible = false, $wrapContent = true, $storeLastActiveTab = true)
     {
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Tabs');
-        $templatePathAndFileName = 'EXT:backend/Resources/Private/Templates/DocumentTemplate/' . ($collapsible ? 'Collapse.html' : 'Tabs.html');
+        $templatePath = ExtensionManagementUtility::extPath('backend')
+            . 'Resources/Private/Templates/DocumentTemplate/';
         $view = GeneralUtility::makeInstance(StandaloneView::class);
-        $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templatePathAndFileName));
+        $view->setTemplatePathAndFilename($templatePath . ($collapsible ? 'Collapse.html' : 'Tabs.html'));
+        $view->setPartialRootPaths([$templatePath . 'Partials']);
         $view->assignMultiple([
             'id' => 'DTM-' . GeneralUtility::shortMD5($domId),
             'items' => $menuItems,