Commit 476d6ecf authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Replace wrong routeIdentifier in example code

Some code examples for the ShortcutButton
"routeIdentifier" property, introduced in #93093,
used the non existing "web_view" identifier.

Using this code example will therefore lead to
a RouteNotFoundException exception.

This is now fixed by using the correct identifier
for the viewpage module.

Resolves: #96945
Related: #93093
Releases: main, 11.5
Change-Id: Icf0a7cd476328661a630f24655ec53fe34b78745
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73576


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 4a054d12
...@@ -39,7 +39,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; ...@@ -39,7 +39,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
* $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); * $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
* $pageId = (int)($request->getQueryParams()['id'] ?? 0); * $pageId = (int)($request->getQueryParams()['id'] ?? 0);
* $myButton = $buttonBar->makeShortcutButton() * $myButton = $buttonBar->makeShortcutButton()
* ->setRouteIdentifier('web_view') * ->setRouteIdentifier('web_ViewpageView')
* ->setDisplayName('View page ' . $pageId) * ->setDisplayName('View page ' . $pageId)
* ->setArguments([ * ->setArguments([
* 'id' => $pageId * 'id' => $pageId
......
...@@ -48,7 +48,7 @@ introduced. This method expects the full set of arguments and values to create a ...@@ -48,7 +48,7 @@ introduced. This method expects the full set of arguments and values to create a
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
$pageId = (int)($request->getQueryParams()['id'] ?? 0); $pageId = (int)($request->getQueryParams()['id'] ?? 0);
$shortCutButton = $buttonBar->makeShortcutButton() $shortCutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('web_view') ->setRouteIdentifier('web_ViewpageView')
->setDisplayName('View page ' . $pageId) ->setDisplayName('View page ' . $pageId)
->setArguments([ ->setArguments([
'id' => $pageId, 'id' => $pageId,
......
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