diff --git a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php index df37bce3bbeefb6fd0c528cde6a7e21fa1aa7fab..45e48749806849fee05597de99d587eaf1867295 100644 --- a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php +++ b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php @@ -23,9 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction; 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\Core\Utility\PathUtility; use TYPO3\CMS\Lang\LanguageService; /** @@ -262,8 +260,8 @@ class PagePositionMap /** * Creates the onclick event for the insert-icons. * - * TSconfig mod.web_list.newPageWiz.overrideWithExtension may contain an extension which provides a module - * to be used instead of the normal create new page wizard. + * TSconfig mod.newPageWizard.override may contain an alternative module / route which can be + * used instead of the normal create new page wizard. * * @param int $pid The pid. * @param int $newPagePID New page id. @@ -271,12 +269,16 @@ class PagePositionMap */ public function onClickEvent($pid, $newPagePID) { - $TSconfigProp = $this->getModConfig($newPagePID); - if ($TSconfigProp['overrideWithExtension']) { - if (ExtensionManagementUtility::isLoaded($TSconfigProp['overrideWithExtension'])) { - $onclick = 'window.location.href=' . GeneralUtility::quoteJSvalue(PathUtility::getAbsoluteWebPath(ExtensionManagementUtility::extPath($TSconfigProp['overrideWithExtension'])) . 'mod1/index.php?cmd=crPage&positionPid=' . $pid) . ';'; - return $onclick; - } + $TSconfig = BackendUtility::getModTSconfig($newPagePID, 'mod.newPageWizard'); + $TSconfig = $TSconfig['properties']; + if (isset($TSconfig['override']) && !empty($TSconfig['override'])) { + $url = BackendUtility::getModuleUrl($TSconfig['override'], [ + 'positionPid' => $pid, + 'newPageId' => $newPagePID, + 'cmd' => 'crPage', + 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')] + ); + return 'window.location.href=' . GeneralUtility::quoteJSvalue($url) . ';'; } $params = '&edit[pages][' . $pid . ']=new&returnNewPageId=1'; return BackendUtility::editOnClick($params, '', $this->R_URI); diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-78549-OverridePagePositionMapWizardViaPageTSconfig.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-78549-OverridePagePositionMapWizardViaPageTSconfig.rst new file mode 100644 index 0000000000000000000000000000000000000000..1b34c736d91b026f572b8709a482c2acf0bfee99 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-78549-OverridePagePositionMapWizardViaPageTSconfig.rst @@ -0,0 +1,48 @@ +.. include:: ../../Includes.txt + +====================================================================== +Breaking: #78549 - Override New Page Creation Wizard via page TSconfig +====================================================================== + +See :issue:`78549` + +Description +=========== + +In the past it was possible to override the "New Page Creation Wizard" via custom scripts +when using page TSconfig via ``mod.web_list.newPageWiz.overrideWithExtension = myextension`` to define an extension, +which then needed a file placed under ``mod1/index.php``. The script was then called with certain parameters instead +of the wizard. + +The new way of handling entry-points and custom scripts is now built via modules and routes. The former option +``mod.web_list.newPageWiz.overrideWithExtension`` has been removed and a new option +``mod.newPageWizard.override`` was introduced instead. Instead of setting the option to a certain extension key, +a custom module or route has to be specified. + +Example: + +.. code-block:: typoscript + + mod.newPageWizard.override = my_custom_module + + +Impact +====== + +Using the old TSconfig option ``mod.web_list.newPageWiz.overrideWithExtension`` has no effect anymore and +will fallback to the regular new page creation wizard provided by the TYPO3 Core. + + +Affected Installations +====================== + +Any installation using this option with extensions providing custom New Page Wizards, e.g. templavoila. + + +Migration +========= + +The extension providing the script must be changed to register a route or module and set the TSconfig option to the route identifier, +instead of a raw PHP script. Any usages in TSconfig need to be adapted to use the new TSconfig option. + +.. index:: Backend, TSConfig