Skip to content

Commit

Permalink
[BUGFIX] Set correct default value for page action callbacks
Browse files Browse the repository at this point in the history
This patch sets the correct default value for page action callbacks passed
for `TYPO3/CMS/Backend/PageActions`. Empty strings are not treated
properly, also the argument of `PageRenderer::loadRequireJsModule` sets
the default value to null.

Resolves: #88649
Related: #88532
Releases: master, 9.5
Change-Id: Ic5ce5eca5c0f2845ff9453e5f8d50de7cd650356
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61367
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
andreaskienast committed Aug 5, 2019
1 parent 6f0e97c commit f0ba841
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/backend/Classes/View/PageLayoutView.php
Expand Up @@ -859,7 +859,7 @@ public function getTable_tt_content($id)
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LayoutModule/DragDrop');
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LayoutModule/Paste');
$pageActionsCallback = '';
$pageActionsCallback = null;
if ($this->isPageEditable()) {
$languageOverlayId = 0;
$pageLocalizationRecord = BackendUtility::getRecordLocalization('pages', $this->id, (int)$this->tt_contentConfig['sys_language_uid']);
Expand Down
Expand Up @@ -347,7 +347,7 @@ protected function main(ServerRequestInterface $request = null)
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/AjaxDataHandler');
$calcPerms = $backendUser->calcPerms($this->pageinfo);
$userCanEditPage = $calcPerms & Permission::PAGE_EDIT && !empty($this->id) && ($backendUser->isAdmin() || (int)$this->pageinfo['editlock'] === 0);
$pageActionsCallback = '';
$pageActionsCallback = null;
if ($userCanEditPage) {
$pageActionsCallback = 'function(PageActions) {
PageActions.setPageId(' . (int)$this->id . ');
Expand Down

0 comments on commit f0ba841

Please sign in to comment.