Commit ab386777 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Christian Kuhn
Browse files

[TASK] Remove deprecated "route" argument from shortcut buttons

With #93093 the shortcut PHP API was reworked.
Since then, providing the route path as "route"
argument is deprecated.

This patch removes all places in the core where
the argument was still being set.

Resolves: #93224
Releases: master
Change-Id: I4496e88f67f7e821653af31b647b1825b6cc3371
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67343


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 205df901
...@@ -1800,9 +1800,7 @@ class EditDocumentController ...@@ -1800,9 +1800,7 @@ class EditDocumentController
'returnNewPageId', 'returnNewPageId',
'noView' 'noView'
]; ];
$arguments = [ $arguments = [];
'route' => $queryParams['route'],
];
foreach ($potentialArguments as $argument) { foreach ($potentialArguments as $argument) {
if (!empty($queryParams[$argument])) { if (!empty($queryParams[$argument])) {
$arguments[$argument] = $queryParams[$argument]; $arguments[$argument] = $queryParams[$argument];
......
...@@ -123,7 +123,7 @@ class SiteConfigurationController ...@@ -123,7 +123,7 @@ class SiteConfigurationController
*/ */
protected function overviewAction(ServerRequestInterface $request): void protected function overviewAction(ServerRequestInterface $request): void
{ {
$this->configureOverViewDocHeader($request->getQueryParams()['route']); $this->configureOverViewDocHeader();
$allSites = $this->siteFinder->getAllSites(); $allSites = $this->siteFinder->getAllSites();
$pages = $this->getAllSitePages(); $pages = $this->getAllSitePages();
$unassignedSites = []; $unassignedSites = [];
...@@ -627,10 +627,8 @@ class SiteConfigurationController ...@@ -627,10 +627,8 @@ class SiteConfigurationController
/** /**
* Create document header buttons of "overview" action * Create document header buttons of "overview" action
*
* @param string $route
*/ */
protected function configureOverViewDocHeader(string $route): void protected function configureOverViewDocHeader(): void
{ {
$iconFactory = $this->moduleTemplate->getIconFactory(); $iconFactory = $this->moduleTemplate->getIconFactory();
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
...@@ -641,10 +639,7 @@ class SiteConfigurationController ...@@ -641,10 +639,7 @@ class SiteConfigurationController
$buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT); $buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT);
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('site_configuration') ->setRouteIdentifier('site_configuration')
->setDisplayName($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_module.xlf:mlang_labels_tablabel')) ->setDisplayName($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_module.xlf:mlang_labels_tablabel'));
->setArguments([
'route' => $route
]);
$buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
} }
......
...@@ -175,10 +175,7 @@ class PermissionController extends ActionController ...@@ -175,10 +175,7 @@ class PermissionController extends ActionController
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('system_BeuserTxPermission') ->setRouteIdentifier('system_BeuserTxPermission')
->setDisplayName($this->getShortcutTitle()) ->setDisplayName($this->getShortcutTitle())
->setArguments([ ->setArguments(['id' => (int)$this->id]);
'route' => GeneralUtility::_GP('route'),
'id' => (int)$this->id,
]);
$buttonBar->addButton($shortcutButton); $buttonBar->addButton($shortcutButton);
} }
......
...@@ -665,10 +665,7 @@ class FileListController extends ActionController implements LoggerAwareInterfac ...@@ -665,10 +665,7 @@ class FileListController extends ActionController implements LoggerAwareInterfac
$shortCutButton = $buttonBar->makeShortcutButton() $shortCutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('file_FilelistList') ->setRouteIdentifier('file_FilelistList')
->setDisplayName($this->getShortcutTitle()) ->setDisplayName($this->getShortcutTitle())
->setArguments([ ->setArguments(['id' => $this->id]);
'route' => GeneralUtility::_GP('route'),
'id' => $this->id,
]);
$buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT); $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
// Upload button (only if upload to this directory is allowed) // Upload button (only if upload to this directory is allowed)
......
...@@ -477,10 +477,7 @@ class FormManagerController extends AbstractBackendController ...@@ -477,10 +477,7 @@ class FormManagerController extends AbstractBackendController
// Shortcut // Shortcut
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('web_FormFormbuilder') ->setRouteIdentifier('web_FormFormbuilder')
->setDisplayName($this->getLanguageService()->sL('LLL:EXT:form/Resources/Private/Language/Database.xlf:module.shortcut_name')) ->setDisplayName($this->getLanguageService()->sL('LLL:EXT:form/Resources/Private/Language/Database.xlf:module.shortcut_name'));
->setArguments([
'route' => GeneralUtility::_GP('route')
]);
$buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
} }
......
...@@ -272,10 +272,8 @@ class InfoModuleController ...@@ -272,10 +272,8 @@ class InfoModuleController
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 1); $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
// Shortcut // Shortcut
$queryParams = $request->getQueryParams();
$shortcutArguments = [ $shortcutArguments = [
'route' => $queryParams['route'], 'id' => $request->getQueryParams()['id'] ?? 0,
'id' => $queryParams['id'] ?? 0,
]; ];
foreach (array_keys($this->MOD_MENU) as $key) { foreach (array_keys($this->MOD_MENU) as $key) {
if (!empty($this->MOD_SETTINGS[$key])) { if (!empty($this->MOD_SETTINGS[$key])) {
......
...@@ -124,10 +124,7 @@ class ConfigurationController ...@@ -124,10 +124,7 @@ class ConfigurationController
$shortcutButton $shortcutButton
->setRouteIdentifier('system_config') ->setRouteIdentifier('system_config')
->setDisplayName($configurationProvider->getLabel()) ->setDisplayName($configurationProvider->getLabel())
->setArguments([ ->setArguments(['tree' => $configurationProviderIdentifier]);
'route' => $request->getQueryParams()['route'],
'tree' => $configurationProviderIdentifier,
]);
$moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortcutButton); $moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortcutButton);
// Main drop down in doc header // Main drop down in doc header
......
...@@ -143,7 +143,6 @@ class DatabaseIntegrityController ...@@ -143,7 +143,6 @@ class DatabaseIntegrityController
->setRouteIdentifier($this->moduleName) ->setRouteIdentifier($this->moduleName)
->setDisplayName($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]) ->setDisplayName($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']])
->setArguments([ ->setArguments([
'route' => $request->getQueryParams()['route'],
'SET' => [ 'SET' => [
'function' => $this->MOD_SETTINGS['function'] ?? '', 'function' => $this->MOD_SETTINGS['function'] ?? '',
'search' => $this->MOD_SETTINGS['search'] ?? 'raw', 'search' => $this->MOD_SETTINGS['search'] ?? 'raw',
......
...@@ -593,7 +593,6 @@ class DatabaseRecordList ...@@ -593,7 +593,6 @@ class DatabaseRecordList
$shortCutButton = $buttonBar->makeShortcutButton()->setRouteIdentifier('web_list'); $shortCutButton = $buttonBar->makeShortcutButton()->setRouteIdentifier('web_list');
$queryParams = $request->getQueryParams(); $queryParams = $request->getQueryParams();
$arguments = [ $arguments = [
'route' => $queryParams['route'],
'id' => $this->id 'id' => $this->id
]; ];
$potentialArguments = [ $potentialArguments = [
......
...@@ -159,10 +159,7 @@ class RecyclerModuleController ...@@ -159,10 +159,7 @@ class RecyclerModuleController
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('web_RecyclerRecycler') ->setRouteIdentifier('web_RecyclerRecycler')
->setDisplayName($this->getShortcutTitle()) ->setDisplayName($this->getShortcutTitle())
->setArguments([ ->setArguments(['id' => (int)$this->id]);
'route' => $route,
'id' => (int)$this->id
]);
$buttonBar->addButton($shortcutButton); $buttonBar->addButton($shortcutButton);
$reloadButton = $buttonBar->makeLinkButton() $reloadButton = $buttonBar->makeLinkButton()
......
...@@ -179,10 +179,7 @@ class ManagementController ...@@ -179,10 +179,7 @@ class ManagementController
// Shortcut // Shortcut
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('site_redirects') ->setRouteIdentifier('site_redirects')
->setDisplayName($this->getLanguageService()->sL('LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:mlang_labels_tablabel')) ->setDisplayName($this->getLanguageService()->sL('LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:mlang_labels_tablabel'));
->setArguments([
'route' => $this->request->getQueryParams()['route'],
]);
$buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
} }
......
...@@ -116,7 +116,6 @@ class ReportController ...@@ -116,7 +116,6 @@ class ReportController
->setRouteIdentifier('system_reports') ->setRouteIdentifier('system_reports')
->setDisplayName($this->shortcutName) ->setDisplayName($this->shortcutName)
->setArguments([ ->setArguments([
'route' => $request->getQueryParams()['route'],
'action' => $action, 'action' => $action,
'extension' => $extension, 'extension' => $extension,
'report' => $request->getQueryParams()['report'] ?? $request->getParsedBody()['report'] ?? '', 'report' => $request->getQueryParams()['report'] ?? $request->getParsedBody()['report'] ?? '',
......
...@@ -1373,7 +1373,6 @@ class SchedulerModuleController ...@@ -1373,7 +1373,6 @@ class SchedulerModuleController
// Shortcut // Shortcut
$shortcutArguments = [ $shortcutArguments = [
'route' => $queryParams['route'],
'CMD' => (string)Action::cast($queryParams['CMD'] ?? null), 'CMD' => (string)Action::cast($queryParams['CMD'] ?? null),
'SET' => [ 'SET' => [
'function' => $this->MOD_SETTINGS['function'], 'function' => $this->MOD_SETTINGS['function'],
......
...@@ -431,10 +431,7 @@ class SetupModuleController ...@@ -431,10 +431,7 @@ class SetupModuleController
$buttonBar->addButton($saveButton); $buttonBar->addButton($saveButton);
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier($this->moduleName) ->setRouteIdentifier($this->moduleName)
->setDisplayName($this->getLanguageService()->sL('LLL:EXT:setup/Resources/Private/Language/locallang_mod.xlf:mlang_labels_tablabel')) ->setDisplayName($this->getLanguageService()->sL('LLL:EXT:setup/Resources/Private/Language/locallang_mod.xlf:mlang_labels_tablabel'));
->setArguments([
'route' => $route,
]);
$buttonBar->addButton($shortcutButton); $buttonBar->addButton($shortcutButton);
} }
......
...@@ -375,10 +375,7 @@ class TypoScriptTemplateModuleController ...@@ -375,10 +375,7 @@ class TypoScriptTemplateModuleController
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('web_ts') ->setRouteIdentifier('web_ts')
->setDisplayName($this->getShortcutTitle()) ->setDisplayName($this->getShortcutTitle())
->setArguments([ ->setArguments(['id' => (int)$this->id]);
'route' => $this->request->getQueryParams()['route'],
'id' => (int)$this->id
]);
$buttonBar->addButton($shortcutButton); $buttonBar->addButton($shortcutButton);
} }
......
...@@ -138,10 +138,7 @@ class ViewModuleController ...@@ -138,10 +138,7 @@ class ViewModuleController
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('web_ViewpageView') ->setRouteIdentifier('web_ViewpageView')
->setDisplayName($this->getShortcutTitle($pageId)) ->setDisplayName($this->getShortcutTitle($pageId))
->setArguments([ ->setArguments(['id' => $pageId]);
'route' => $route,
'id' => $pageId,
]);
$buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
} }
......
...@@ -188,10 +188,7 @@ class ReviewController ...@@ -188,10 +188,7 @@ class ReviewController
$shortcutButton = $buttonBar->makeShortcutButton() $shortcutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('web_WorkspacesWorkspaces') ->setRouteIdentifier('web_WorkspacesWorkspaces')
->setDisplayName(sprintf('%s: %s [%d]', $activeWorkspaceTitle, $pageTitle, $this->pageId)) ->setDisplayName(sprintf('%s: %s [%d]', $activeWorkspaceTitle, $pageTitle, $this->pageId))
->setArguments([ ->setArguments(['id' => (int)$this->pageId]);
'route' => (string)GeneralUtility::_GP('route'),
'id' => (int)$this->pageId,
]);
$buttonBar->addButton($shortcutButton); $buttonBar->addButton($shortcutButton);
$this->moduleTemplate->setContent($this->view->render()); $this->moduleTemplate->setContent($this->view->render());
......
Supports Markdown
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