Deprecation: #92062 - Migrate RecordListController hooks to an PSR-14 event

See Issue #92062

Description

The following hooks have been marked as deprecated:

  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook']
  • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook']

Both hooks could be used to add content before or after the main content of the list module.

Impact

Using the hooks still works as before, but a deprecation message is triggered. The hooks will be removed and stop working in TYPO3 v12.0. Please migrate to the PSR-14 event: TYPO3\CMS\Recordlist\Event\RenderAdditionalContentToRecordListEvent.

Affected Installations

TYPO3 installations with extensions that hook into the RecordListController.

Migration

The functionality of both hooks has been migrated to the following PSR-14 event: TYPO3\CMS\Recordlist\Event\RenderAdditionalContentToRecordListEvent.

The event class contains the following relevant public methods:

  • getRequest Returns the request object from the list module request.
  • addContentAbove Add additional content as string as it is to be shown above the main content.
  • addContentBelow Add additional content as string as it is to be shown below the main content.

The event object is used as parameter for the event listener method (default is __invoke).

The listener needs to be registered in the extension: EXT:myext/Configuration/Services.yaml.

Example:

My\Extension\Provider\MyAdditionalContentProvider:
   tags:
      - name: event.listener
        identifier: 'my-additional-content'
        event: TYPO3\CMS\Recordlist\Event\RenderAdditionalContentToRecordListEvent

Please have a look at TYPO3\CMS\SysNote\Provider\RecordListProvider as an example for the listener implementation.