[BUGFIX] Register SVG icons for backend modules automatically 43/52043/8
authorCedric Ziel <cedric@cedric-ziel.com>
Tue, 14 Mar 2017 16:20:36 +0000 (17:20 +0100)
committerFrank Nägler <frank.naegler@typo3.org>
Wed, 15 Mar 2017 09:37:38 +0000 (10:37 +0100)
Releases: master
Fixes: #80278
Change-Id: Idcb7efa0fb7a5ad819ce0f65a837916cdeb13c56
Reviewed-on: https://review.typo3.org/52043
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index db407e8..16227e3 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Core\Utility;
  */
 
 use TYPO3\CMS\Core\Category\CategoryRegistry;
-use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
 use TYPO3\CMS\Core\Imaging\IconRegistry;
 use TYPO3\CMS\Core\Migrations\TcaMigration;
 use TYPO3\CMS\Core\Package\PackageManager;
@@ -882,11 +881,14 @@ class ExtensionManagementUtility
 
         // Register the icon and move it too "iconIdentifier"
         if (!empty($moduleConfiguration['icon'])) {
-            $iconIdentifier = 'module-' . $moduleSignature;
             $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
-            $iconRegistry->registerIcon($iconIdentifier, BitmapIconProvider::class, [
-                'source' => GeneralUtility::getFileAbsFileName($moduleConfiguration['icon'])
-            ]);
+            $iconIdentifier = 'module-' . $moduleSignature;
+            $iconProvider = $iconRegistry->detectIconProvider($moduleConfiguration['icon']);
+            $iconRegistry->registerIcon(
+                $iconIdentifier,
+                $iconProvider,
+                [ 'source' => GeneralUtility::getFileAbsFileName($moduleConfiguration['icon']) ]
+            );
             $moduleConfiguration['iconIdentifier'] = $iconIdentifier;
             unset($moduleConfiguration['icon']);
         }
@@ -950,11 +952,14 @@ class ExtensionManagementUtility
             }
 
             if (!empty($moduleConfiguration['icon'])) {
-                $iconIdentifier = 'module-' . $fullModuleSignature;
                 $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
-                $iconRegistry->registerIcon($iconIdentifier, BitmapIconProvider::class, [
-                    'source' => GeneralUtility::getFileAbsFileName($moduleConfiguration['icon'])
-                ]);
+                $iconIdentifier = 'module-' . $fullModuleSignature;
+                $iconProvider = $iconRegistry->detectIconProvider($moduleConfiguration['icon']);
+                $iconRegistry->registerIcon(
+                    $iconIdentifier,
+                    $iconProvider,
+                    [ 'source' => GeneralUtility::getFileAbsFileName($moduleConfiguration['icon']) ]
+                );
                 $moduleConfiguration['iconIdentifier'] = $iconIdentifier;
                 unset($moduleConfiguration['icon']);
             }