Issue Bug Closed

#89558Bitmap icons for modules are not rendered anymore

Xavier Perseguers 10/31/19, 11:50 updated 04/28/20, 11:09

Description

This is the updated module registration for EXT:ig_ldap_sso_auth in TYPO3 v10:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
    $_EXTKEY,
    'system',
    'txigldapssoauthM1',
    'top',
    [
        \Causal\IgLdapSsoAuth\Controller\ModuleController::class => implode(',', [
            'index',
            'status',
            'search',
            'importFrontendUsers', 'importBackendUsers',
            'importFrontendUserGroups', 'importBackendUserGroups',
        ]),
    ], [
        'access' => 'admin',
        'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/module-ldap.png',
        'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf'
    ]
);

Prior to commit d750a7a2eae (#89206), or in TYPO3 v8/v9, the module was rendered like that:

v9.png

In TYPO3 v10, this is what happens:

v10.png

Reason is that this changed:

--- a/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
+++ b/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
@@ -348,7 +348,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
         $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
         if ($iconRegistry->isRegistered($iconIdentifier)) {
             $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-            return $iconFactory->getIcon($iconIdentifier)->render();
+            return $iconFactory->getIcon($iconIdentifier)->render('inline');
         }
         return '';
     }

which renders the Bitmap icon as:

<image width="32" height="32" xlink:href="/typo3conf/ext/ig_ldap_sso_auth/Resources/Public/Icons/module-ldap.png"/>

which in turns get interpreted like that by the browser:

<img width="32" height="32" xlink:href="/typo3conf/ext/ig_ldap_sso_auth/Resources/Public/Icons/module-ldap.png"/>

The tag lacks the src attribute and this originates from asking ‘inline’ alternative.

Reviews 3