Feature: #101603 - PSR-14 event for modifying record overlay icon identifier

See forge#101603

Description

A new PSR-14 event \TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent has been introduced which serves as a direct replacement for the now removed $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\Imaging\IconFactory']['overrideIconOverlay'] hook.

To modify the overlay icon identifier, the following methods are available:

  • setOverlayIconIdentifier(): Allows to set the overlay icon identifier
  • getOverlayIconIdentifier(): Returns the overlay icon identifier
  • getTable(): Returns the record's table name
  • getRow(): Returns the record's database row
  • getStatus(): Returns the record's visibility status

Example

The corresponding event listener class:

<?php

namespace Vendor\MyPackage\Core\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent;

final class ModifyRecordOverlayIconIdentifierEventListener
{
    #[AsEventListener('my-package/core/modify-record-overlay-icon-identifier')]
    public function __invoke(ModifyRecordOverlayIconIdentifierEvent $event): void
    {
        $event->setOverlayIconIdentifier('my-overlay-icon-identifier');
    }
}
Copied!

Impact

It's now possible to modify the overlay icon identifier of any record icon, using the new PSR-14 event ModifyRecordOverlayIconIdentifierEvent.