Bug #76996

Language flags (css classes and sprites) got removed in 7.6.0

Added by Thomas Mayer over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2016-07-09
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

According to the commit message of issue 70477 some deprecations take place for v7 LTS via 7.6.0

https://forge.typo3.org/issues/70477
https://review.typo3.org/#/c/43897/
https://github.com/TYPO3/TYPO3.CMS/commit/58c46d75099acd8449aded959efe8f031cec13d0
https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.6/Deprecation-70477-DeprecateSpriteIconClasses.html

But this commit does more than a deprecation because it also removes files

typo3/sysext/core/Resources/Public/Css/flags.css
typo3/sysext/core/Resources/Public/Images/Sprites/flags.png

And it also removes a bugfix which was merged with 7.4.0

https://forge.typo3.org/issues/68217
https://github.com/TYPO3/TYPO3.CMS/commit/58c46d75099acd8449aded959efe8f031cec13d0#diff-c0eb99ae079c86116b6b94bb0cc1a7beL489

I'd be happy to still be able to support 6.2 with metaseo extension and move to IconRegistry as soon as we drop support for 6.2.
Details: https://github.com/mblaschke/TYPO3-metaseo/issues/257
Our old 6.2-style code is missing css classes for language flags and therefore only displays a red X icon.
We're using the css classes for flags in the backend.

I guess 58c46d75099acd8449aded959efe8f031cec13d0 must at least be considered as a breaking change the way it was done. Is that intended or is it a bug or was there a breaking change in the past (pre-6.2) which allows for the removal of the files?

Removal of flags.css and flags.png was suggested by Wouter Wolters (with a question mark).
A breaking change was suggested by Christian Kuhn (with a question mark) for Patch set 7 of https://review.typo3.org/#/c/43897/ But no breaking change was communicated.

I'm not sure if that was a breaking change, a bug or totally fine. Please give some feedback which was the intention here. For the moment it looks more like a bug to me, while I'm aware that there is a modern alternative in 7.6.x.

Suggested fix would be to give back the dropped files, css classes and bugfix 68217 for 7.6.x only.


Related issues

Related to TYPO3 Core - Task #70477: Deprecate SpriteIcon classes Closed 2015-10-07
Related to TYPO3 Core - Bug #68217: list view > website language > Flag icons not shown Resolved 2015-07-16
Related to TYPO3 Core - Feature #77048: Backend: Embed SVG icons and flags in css New 2016-07-11

Associated revisions

Revision 3c47cec7 (diff)
Added by Frank Naegler over 1 year ago

[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: Thomas Mayer <>
Tested-by: Thomas Mayer <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Thomas Mayer over 1 year ago

Calling deprecated function in 7.6.10-dev

IconUtility::getSpriteIcon('flags-de');

is broken in 7.6. I get a red cross for that while the HTML output is

<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>

It could fall back to

/** @var \TYPO3\CMS\Core\Imaging\IconFactory $iconFactory */
$iconFactory = Typo3GeneralUtility::makeInstance('TYPO3\CMS\Core\Imaging\IconFactory');
$iconFactory->getIcon('flags-de', Icon::SIZE_SMALL);

Which gives me the HTML output

<span class="t3js-icon icon icon-size-small icon-state-default icon-flags-de" data-identifier="flags-de">
  <span class="icon-markup">
    <img src="/typo3/sysext/core/Resources/Public/Icons/Flags/SVG/DE.svg" height="16" width="16">
  </span>
</span>

So the suggested fix could be to let IconUtility::getSpriteIcon() call $iconFactory->getIcon().

That would result in SVG output (consistent with other SVG flags).

Note that 7.6.10-dev code documentation still suggests the use of IconUtility in respect to flags, e.g.

typo3/sysext/backend/Classes/Configuration/TranslationConfigurationProvider.php Line 47:
The calling party should call
     * \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon(<flags-xx>) to get an HTML
     * which will represent the flag of this language.

Additionally, old css and .PNG flags and bugfix 68217 could be of use when used directly without using IconUtility::getSpriteIcon() or $iconFactory->getIcon() to make mitigate the breaking change.

#2 Updated by Thomas Mayer over 1 year ago

Another option would be to implement issue 77048, which embeds all the SVG files into few css files. 77048 also allows to use simple CSS classes again while the same class names could be used as in 6.2, at least for a transition/deprecation concept.

If backported to 7.6, 77048 could even potentially mitigate the breaking change (which occured via 70477), still giving all the benefits of SVG, plus improving backend's performance in 7.6 and beyond.

#3 Updated by Frank Naegler over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Frank Naegler

thank you for your report. I can confirm the broken spriteIcon stuff for the flags and will come up with a fix-

#4 Updated by Gerrit Code Review over 1 year ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49161

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49161

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49161

#7 Updated by Frank Naegler over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF