Skip to content
Snippets Groups Projects
Commit 3c47cec7 authored by Frank Naegler's avatar Frank Naegler Committed by Christian Kuhn
Browse files

[BUGFIX] Fix broken language flags via IconUtility::getSpriteIcon

With #70477 the SpriteIcon stuff has been marked as deprecated.
The patch removed the flags support. This patch fix the problem by checking
the IconRegisty and return the icon by using the IconFactory.

Resolves: #76996
Related: #70477
Releases: 7.6
Change-Id: I0323c6bc132eb9a8049294ee66ac3cf37d10f9fd
Reviewed-on: https://review.typo3.org/49161


Reviewed-by: default avatarThomas Mayer <thomas.mayer@2bis10.de>
Tested-by: default avatarThomas Mayer <thomas.mayer@2bis10.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 0c449ce1
Branches
Tags
No related merge requests found
......@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Utility;
use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Versioning\VersionState;
......@@ -596,6 +597,15 @@ class IconUtility
public static function getSpriteIcon($iconName, array $options = array(), array $overlays = array())
{
GeneralUtility::logDeprecatedFunction();
// First check if an icon is registered in IconRegistry and
// return if icon is available.
$iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
if ($iconRegistry->isRegistered($iconName)) {
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
return $iconFactory->getIcon($iconName, Icon::SIZE_SMALL)->render();
}
// Check if icon can be cached and return cached version if present
if (empty($options) && empty($overlays)) {
if (isset(static::$spriteIconCache[$iconName])) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment