Deprecation: #92132 - Shortcut PHP API
See forge#92132
Description
Some methods related to shortcut / bookmark handling in TYPO3 Backend have been marked as deprecated:
TYPO3\
CMS\ Backend\ Template\ Module Template->make Shortcut Icon () TYPO3\
CMS\ Backend\ Template\ Module Template->make Shortcut Url () TYPO3\
CMS\ Backend\ Template\ Components\ Buttons\ Action\ Shortcut Button->get Set Variables () TYPO3\
CMS\ Backend\ Template\ Components\ Buttons\ Action\ Shortcut Button->get Get Variables () TYPO3\
CMS\ Backend\ Template\ Components\ Buttons\ Action\ Shortcut Button->set Get Variables () TYPO3\
CMS\ Backend\ Template\ Components\ Buttons\ Action\ Shortcut Button->set Set Variables ()
See also:
Impact
Using those methods directly or indirectly will trigger PHP E_
errors.
Affected Installations
Extensions with backend modules that show the shortcut button in the doc header may be affected. The extension scanner will find all PHP usages as weak match.
Migration
The new method TYPO3\
has been
introduced. This method expects the full set of arguments and values to create a shortcut to a specific view, example:
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
$pageId = (int)($request->getQueryParams()['id'] ?? 0);
$shortCutButton = $buttonBar->makeShortcutButton()
->setRouteIdentifier('page_preview')
->setDisplayName('View page ' . $pageId)
->setArguments([
'id' => $pageId,
]);
$buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
Copied!