Bug #72505
closedCannot override a record overlay
100%
Description
Prior to TYPO3 7 LTS, it was possible to override a record overlay in Web > List.
This was used in some extensions such as EXT:ig_ldap_sso_auth to visually show that a corresponding record was related to LDAP in Web > List:
Registration was done from one part in ext_tables.php
:
$GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayPriorities'][] = 'is_ldap_record'; $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames']['is_ldap_record'] = 'extensions-' . $_EXTKEY . '-overlay-ldap-record';
which allowed to register an additional overlay priority and the mapping to the corresponding icon to be used. This is something that is not possible anymore since the list of priorities and the mapping to the name is now hard coded in \TYPO3\CMS\Core\Imaging\IconFactory::$overlayPriorities
and \TYPO3\CMS\Core\Imaging\IconFactory::$recordStatusMapping
without any possibility to change them.
And another part was in ext_localconf.php
:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][] = 'EXT:' . $_EXTKEY . '/Classes/Hooks/DatabaseRecordListIconUtility.php:Causal\\IgLdapSsoAuth\\Hooks\\DatabaseRecordListIconUtility';
The hook was previously called by \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordOverlayToSpriteIconName
but it has not been copied over. This has been documented as breaking by #69057 but without any possible replacement.
Extensions are now unable to do such thing and as such we dropped a feature without any replacement while refactoring the icon utility.
Files
Updated by Markus Klein almost 9 years ago
- Assignee set to Frank Nägler
Frank can you check on that?
Updated by Frank Nägler almost 9 years ago
- Status changed from New to Needs Feedback
Thanks for the report.
Do you agree that we need the following things?
- Solution to manipulate
\TYPO3\CMS\Core\Imaging\IconFactory::$overlayPriorities
- Solution to manipulate
\TYPO3\CMS\Core\Imaging\IconFactory::$recordStatusMapping
- Solution (Hook/Signal) to overwrite the calculated iconName in
\TYPO3\CMS\Core\Imaging\IconFactory::mapRecordTypeToOverlayIdentifier()
before returning the iconName
If you agree, I will take care of this three things.
Updated by Xavier Perseguers almost 9 years ago
Yes I agree.
Regarding the hook/signal, I'd tend for a hook because the concept of signal is misused in core and should only be for signaling something, not to modify data or use something in return.
A way to modify the hard-coded fields could be to have additional hooks with internal getters (to be used afterwards), just an idea.
Updated by Frank Nägler almost 9 years ago
Fully agree, a hook is the way to go to manipulate this data.
My idea is to move the both arrays $overlayPriorities
and $recordStatusMapping
to our configuration and remove the hardcoded arrays.
This way, it is possible to define the default values and extend it very easy with custom values.
Updated by Gerrit Code Review almost 9 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45552
Updated by Gerrit Code Review almost 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45552
Updated by Gerrit Code Review almost 9 years ago
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/45808
Updated by Frank Nägler almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset cd76812d411e5e841abbdc629a74c1f75a2da745.
Updated by Gerrit Code Review almost 9 years ago
- Status changed from Resolved to Under Review
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/45808
Updated by Frank Nägler almost 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset 2a3c7f8054a021e494b55940b2065e10a7455300.