Issue Bug Closed

#72926IconFactory getIconForRecord might not produce correct icon in ajax (inline) context

Andreas Allacher 01/25/16, 13:28 updated 10/21/17, 17:45

Description

IconFactory uses IconRegistry isRegisterd method in mapRecordTypeToIconIdentifier to determine correct record icon.
This might fail to determine the correct icon as IconRegistry is Singleton and only initializes TCA icons in constructor (if TCA is already set) or in getIconConfigurationByIdentufier.

However, getIconConfigurationByIdentufier happens after the isRegistered checks in mapRecordTypeToIconIdentifier.

To ensure it will also work correctly in various extensions, it might be best to do the initialize checks in all methods in IconRegistry as e.g. getAllRegisteredIconIdentifiers should also include TCA icons, if they weren’t initialized prior.

Reviews 2