-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.8.2
-
None
-
MOODLE_38_STABLE
Themes that use and override the core Fontawesome icon system cannot specify own replacements. If they do, it is possible that custom replacements will be ignored.
get_core_icon_map defines an array of replacements (in the form of Moodle pix icon --> fontawesome glyph): https://github.com/moodle/moodle/blob/5548689ead64b57d43ac9bf4bd996380b0ff9049/lib/classes/output/icon_system_fontawesome.php#L53
These (and additional) replacements are cached by get_icon_name_map, which calls get_core_icon_map only if the cache is empty: https://github.com/moodle/moodle/blob/5548689ead64b57d43ac9bf4bd996380b0ff9049/lib/classes/output/icon_system_fontawesome.php#L440
It seems that sometimes the cache is built by the core icon_system_fontawesome, maybe via Boost. Whenever that happens, subclasses have no way of adding their own replacements, resulting in output errors as in the screenshot that I will attach.
This does not only affect custom themes. There is an override in core theme_classic that should suffer from the same situation: https://github.com/moodle/moodle/blob/73f8c56dfca5dd4028845f1fbbaac0a83e43caf9/theme/classic/classes/output/icon_system_fontawesome.php#L44
Workaround: Themes that rely on this have to write their own cache definition and take care of creating that cache themselves. Example: https://github.com/learnweb/moodle-theme_wwu2019/commit/d7402dfc15abc1bf3c601773b96b04a498102cc1
- will be (partly) resolved by
-
MDL-69109 Theme icons are lost after web upgrade in 3.9 or theme change in other versions
-
- Closed
-