Deprecation: #108008 - Manual shortcut button creation
See forge#108008
Description
Manually creating and adding
\Shortcut
instances to the button bar is deprecated and will trigger a deprecation
warning.
Controllers should use the new
\TYPO3\
method instead, which automatically creates and positions the shortcut button.
Impact
Controllers that manually create and add
\Shortcut
instances to the button bar will trigger a deprecation warning. The shortcut
button will still work as expected.
Affected installations
Installations with custom backend modules that manually create shortcut buttons.
Migration
Replace manual shortcut button creation with the new API.
Before:
$shortcutButton = $this->componentFactory->createShortcutButton()
->setRouteIdentifier('my_module')
->setDisplayName('My Module')
->setArguments(['id' => $pageId]);
$view->addButtonToButtonBar($shortcutButton);
Copied!
After:
$view->getDocHeaderComponent()->setShortcutContext(
routeIdentifier: 'my_module',
displayName: 'My Module',
arguments: ['id' => $pageId]
);
Copied!