Deprecation: #93093 - MethodName in Shortcut PHP API

See forge#93093

Description

Since forge#92723 the TYPO3 backend uses symfony routing for resolving internal endpoints, e.g. modules. This will allow human readable urls and also deep-linking in the future. To achieve this, the shortcut PHP API had to be reworked to be fully compatible with the new routing. See Breaking: #93093 - Rework Shortcut PHP API for more information regarding the rework.

In the course of the rework, following methods within ShortcutButton have been marked as deprecated:

  • TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton->setModuleName()
  • TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton->getModuleName()

Impact

Using those methods directly or indirectly will trigger PHP E_USER_DEPRECATED errors.

Affected Installations

Installations with custom extensions, adding a shortcut button in the module header of their backend modules using the mentioned methods. The extension scanner will find all PHP usages as weak match.

Migration

Use the new methods ShortcutButton->setRouteIdentifier() and ShortcutButton->getRouteIdentifier() as replacement. Please note that these methods require the route identifier of the backend module which may differ from the module name. To find out the route identifier, the "Backend Routes" section within the configuration module can be used.

Before:

$shortCutButton = $buttonBar
    ->makeShortcutButton()
    ->setModuleName('web_list');
Copied!

After:

$shortCutButton = $buttonBar
    ->makeShortcutButton()
    ->setRouteIdentifier('web_list');
Copied!