Skip to content

Commit

Permalink
[BUGFIX] TYPO3 v11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Löffler committed Jul 11, 2024
1 parent e0ca1da commit c57a1d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Classes/Controller/Backend/ImageRecognizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ protected function getFileMetaDataEditLink(int $uid, string $returnUrl = null):

protected function getLanguageFlagHtml($identifier, $title = '', $size = Icon::SIZE_LARGE, $overlay = '', $state = IconState::STATE_DEFAULT)
{
$version = GeneralUtility::makeInstance(VersionNumberUtility::class)->getNumericTypo3Version();
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$icon = $iconFactory->getIcon($identifier, $size, $overlay, IconState::cast($state));
if ($title ?? false) {
$icon->setTitle($title);

if (version_compare($version, '12.0', '>=')) {
if ($title ?? false) {
// @phpstan-ignore-next-line
$icon->setTitle($title);
}
}
return $icon->render();
}
Expand Down

0 comments on commit c57a1d8

Please sign in to comment.