[BUGFIX] Make TSConfig preview configuration work again 80/57380/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Tue, 26 Jun 2018 18:52:41 +0000 (20:52 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 26 Jun 2018 19:44:55 +0000 (21:44 +0200)
Fixes regression introduced in https://review.typo3.org/#/c/56693/
the Page TSConfig is now properly fetched.

Resolves: #85395
Releases: master
Change-Id: I6b1d521139f84d3d55db1cb40167140134f0eba6
Reviewed-on: https://review.typo3.org/57380
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php

index 5d23b15..1548dbc 100644 (file)
@@ -1022,7 +1022,7 @@ class EditDocumentController
         $linkParameters = [];
         $table = $this->previewData['table'] ?: $this->firstEl['table'];
         $recordId = $this->previewData['id'] ?: $this->firstEl['uid'];
-        $previewConfiguration = $pageTsConfig['TCEMAIN.']['preview.'][$table . '.'] ?? [];
+        $previewConfiguration = BackendUtility::getPagesTSconfig($previewPageId)['TCEMAIN.']['preview.'][$table . '.'] ?? [];
         $recordArray = BackendUtility::getRecord($table, $recordId);
 
         // language handling
@@ -1103,10 +1103,10 @@ class EditDocumentController
             $currentPageId = MathUtility::convertToPositiveInteger($pageId);
         }
 
-        $previewConfiguration = $pageTsConfig['TCEMAIN.']['preview.'][$table . '.'] ?? [];
+        $previewConfiguration = BackendUtility::getPagesTSconfig($currentPageId)['TCEMAIN.']['preview.'][$table . '.'] ?? [];
 
         if (isset($previewConfiguration['previewPageId'])) {
-            $previewPageId = $previewConfiguration['previewPageId'];
+            $previewPageId = (int)$previewConfiguration['previewPageId'];
         }
         // if no preview page was configured
         if (!$previewPageId) {