Bug #105316
closedUnhide button in list module for record doesn't show custom overlay-icon
100%
Description
I use the Hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Imaging\IconFactory::class]['overrideIconOverlay'][] to set an overlay icon in the list module depending on the value of a field in my record.
<?php
namespace MyNamespace\MyExtension\Hook;
class IconFactoryHook
{
/**
* @param string $table
* @param array $row
* @param array $status
* @param string $iconName
* @return string the new (or given) $iconName
*/
function postOverlayPriorityLookup($table, array $row, array $status, $iconName) {
if ($table == "my_table") {
$record = $this->getRecordByUid('my_table', $row['uid']);
if ($record['link_type']==1) {
$statusValue = false;
foreach ($status as $item) {
if ($item === true) {
$statusValue = true;
break;
}
}
if (!$statusValue) {
$iconName = 'overlay-shortcut';
}
}
}
return $iconName;
}
Everything works as expected, when I click on a folder in the page tree. However, if I un-hide a hidden record, the overlay icon for hidden is removed, but my custom icon is not shown. Instead there is no overlay-icon shown. And if I hide a record with my custom overlay icon and unhide it again, the record is un-hidden again, but the hide overlay icon stays at it is.
I would expect, that the hook for an overlay-icon is also called when I un-hide a record so that my overlay-icon is shown as it is shown when I click on the folder in the page tree.
Updated by Gerrit Code Review 4 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86643
Updated by Andreas Kienast 4 months ago
Dummy event listener implementation to test the patch in v13:
<?php declare(strict_types=1); namespace Vendor\Package\EventListener; use TYPO3\CMS\Core\Attribute\AsEventListener; use TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent; final class ModifyRecordOverlayIconIdentifierEventListener { #[AsEventListener(identifier: 'icon-modifier', event: ModifyRecordOverlayIconIdentifierEvent::class)] public function __invoke(ModifyRecordOverlayIconIdentifierEvent $event) { if ($event->getTable() === 'tt_content') { if ((int)$event->getRow()['hidden'] === 1) { $event->setOverlayIconIdentifier('overlay-missing'); } } } }
Updated by Gerrit Code Review 4 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86643
Updated by Gerrit Code Review 4 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86643
Updated by Gerrit Code Review 3 months ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86643
Updated by Gerrit Code Review 3 months ago
Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86889
Updated by Gerrit Code Review 3 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86890
Updated by Anonymous 3 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c0710cea6d900997edf4ac0fdaa61eabc5de69b7.