diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php index dccd136a9de5ec4423fd754fea5f7e41fc965d16..353c97d55e803a8b114012a5ad4fcf95d5ba3601 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php @@ -24,6 +24,7 @@ use TYPO3\CMS\Core\Database\Query\QueryHelper; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\RelationHandler; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Imaging\IconRegistry; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Messaging\FlashMessageService; @@ -159,6 +160,7 @@ abstract class AbstractItemProvider } $languageService = $this->getLanguageService(); + $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $special = $result['processedTca']['columns'][$fieldName]['config']['special']; @@ -292,6 +294,12 @@ abstract class AbstractItemProvider foreach ($coValue['items'] as $itemKey => $itemCfg) { $icon = 'empty-empty'; $helpText = []; + if (!empty($itemCfg[1])) { + if ($iconRegistry->isRegistered($itemCfg[1])) { + // Use icon identifier when registered + $icon = $itemCfg[1]; + } + } if (!empty($itemCfg[2])) { $helpText['description'] = $languageService->sL($itemCfg[2]); } diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php index 6a53c286a94b52c4b7ebc066112078332123c553..668b37a10a08a5e6a2efa90781f50baa070e51f8 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php @@ -1093,6 +1093,11 @@ class TcaSelectItemsTest extends UnitTestCase 'anItemKey' => [ 0 => 'anItemTitle', ], + 'anotherKey' => [ + 0 => 'anotherTitle', + 1 => 'status-status-permission-denied', + 2 => 'aDescription', + ], ], ] ]; @@ -1110,6 +1115,12 @@ class TcaSelectItemsTest extends UnitTestCase 2 => 'empty-empty', 3 => null, ], + 2 => [ + 0 => 'anotherTitle', + 1 => 'aKey:anotherKey', + 2 => 'status-status-permission-denied', + 3 => [ 'description' => 'aDescription' ], + ], ]; $result = $this->subject->addData($input); diff --git a/typo3/sysext/core/Classes/Imaging/IconRegistry.php b/typo3/sysext/core/Classes/Imaging/IconRegistry.php index 269561b30d057fe48b97f5cdcd1a6d63c77cf0a3..92eea13d3fc519e8ae0d9f178017d1bb0e3bacbc 100644 --- a/typo3/sysext/core/Classes/Imaging/IconRegistry.php +++ b/typo3/sysext/core/Classes/Imaging/IconRegistry.php @@ -2995,7 +2995,7 @@ class IconRegistry implements SingletonInterface * @param string $iconReference * @return string */ - protected function detectIconProvider($iconReference) + public function detectIconProvider($iconReference) { if (StringUtility::endsWith(strtolower($iconReference), 'svg')) { return SvgIconProvider::class;