[BUGFIX] Allow adding content without page edit permissions 72/59872/2
authorHelmut Hummel <typo3@helhum.io>
Tue, 5 Mar 2019 15:03:34 +0000 (16:03 +0100)
committerTobi Kretschmann <tobi@tobishome.de>
Mon, 15 Apr 2019 08:43:22 +0000 (10:43 +0200)
Resolves: #87687
Releases: master, 9.5
Change-Id: I8113f3fa2facf6b21bc19ee1c445265c5ff4f4b4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59872
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index cf87a95..df64782 100644 (file)
@@ -841,6 +841,7 @@ class PageLayoutView implements LoggerAwareInterface
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LayoutModule/DragDrop');
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LayoutModule/Paste');
+        $pageActionsCallback = '';
         if ($this->isPageEditable()) {
             $languageOverlayId = 0;
             $pageLocalizationRecord = BackendUtility::getRecordLocalization('pages', $this->id, (int)$this->tt_contentConfig['sys_language_uid']);
@@ -850,11 +851,12 @@ class PageLayoutView implements LoggerAwareInterface
             if (!empty($pageLocalizationRecord['uid'])) {
                 $languageOverlayId = $pageLocalizationRecord['uid'];
             }
-            $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/PageActions', 'function(PageActions) {
+            $pageActionsCallback = 'function(PageActions) {
                 PageActions.setPageId(' . (int)$this->id . ');
                 PageActions.setLanguageOverlayId(' . $languageOverlayId . ');
-            }');
+            }';
         }
+        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/PageActions', $pageActionsCallback);
         // Get labels for CTypes and tt_content element fields in general:
         $this->CType_labels = [];
         foreach ($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] as $val) {