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