Bug #72505

Cannot override a record overlay

Added by Xavier Perseguers almost 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2016-01-02
Due date:
% Done:

100%

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

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.

users.png View (17.6 KB) Xavier Perseguers, 2016-01-02 10:13


Related issues

Follows TYPO3 Core - Task #69057: Deprecate IconUtility::getSpriteIconForFile() Closed 2015-08-14

Associated revisions

Revision cd76812d (diff)
Added by Frank Naegler almost 4 years ago

[BUGFIX] Re-Introduce hook to override a record overlay

This patch re-introduces a hook to override a record overlay.
Also move the static recordStatusMapping and overlayPriorities to configuration.

Resolves: #72505
Releases: master, 7.6
Change-Id: Ia7dd7eaba900cb98be598fb4aafc26f41cfd0f46
Reviewed-on: https://review.typo3.org/45552
Reviewed-by: Xavier Perseguers <>
Tested-by: Xavier Perseguers <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision 2a3c7f80 (diff)
Added by Frank Naegler almost 4 years ago

[BUGFIX] Re-Introduce hook to override a record overlay

This patch re-introduces a hook to override a record overlay.
Also move the static recordStatusMapping and overlayPriorities to configuration.

Resolves: #72505
Releases: master, 7.6
Change-Id: Ia7dd7eaba900cb98be598fb4aafc26f41cfd0f46
Reviewed-on: https://review.typo3.org/45808
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

History

#1 Updated by Markus Klein almost 4 years ago

  • Assignee set to Frank Naegler

Frank can you check on that?

#2 Updated by Frank Naegler almost 4 years ago

  • Status changed from New to Needs Feedback

Thanks for the report.

Do you agree that we need the following things?

  1. Solution to manipulate \TYPO3\CMS\Core\Imaging\IconFactory::$overlayPriorities
  2. Solution to manipulate \TYPO3\CMS\Core\Imaging\IconFactory::$recordStatusMapping
  3. 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.

#3 Updated by Xavier Perseguers almost 4 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.

#4 Updated by Frank Naegler almost 4 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.

#5 Updated by Gerrit Code Review almost 4 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

#6 Updated by Gerrit Code Review almost 4 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

#7 Updated by Gerrit Code Review almost 4 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

#8 Updated by Frank Naegler almost 4 years ago

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

#9 Updated by Gerrit Code Review almost 4 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

#10 Updated by Frank Naegler almost 4 years ago

  • Status changed from Under Review to Resolved

#11 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF