Skip to content
Snippets Groups Projects
Commit 958795c7 authored by Benni Mack's avatar Benni Mack Committed by Susanne Moog
Browse files

[!!!][BUGFIX] Allow override of page creation wizard again

The TSconfig option to override the page creation wizard via
`mod.web_list.newPageWiz.overrideWithExtension` is impossible
to use anymore since TYPO3 v8, due to the limitation
of the entry-scripts which are only allowed to be in typo3/index.php
for the backend. The option `mod.newPageWizard.override` was
introduced to register a custom route / module to be linked when
adding new pages.

Resolves: #78549
Releases: master
Change-Id: I1c46c8facad83c0d561028e544f18238abe89f91
Reviewed-on: https://review.typo3.org/50560


Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: default avatarSusanne Moog <susanne.moog@typo3.org>
parent 91459aa7
Branches
Tags
No related merge requests found
......@@ -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);
......
.. 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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment