fontawesome nothing "slicon" shows in themes

fontawesome nothing "slicon" shows in themes

by Garth Brady -
Number of replies: 19
Picture of Particularly helpful Moodlers

We're running a few themes on our site, but we're find that any theme that references fontawesome icons with 'slicon' does not show up.

I would put this in either Adaptable or Fordson, but it does not seem specifically related to a single theme.  Rather, references to 'slicon' across the site fail to display.  The html code is present, but the icon does not get rendered... there's just nothing there at all.

Example:
<pre><i class="icon fa slicon-settings fa-fw " aria-hidden="true"></i></pre>

Produces nothing at all...  I've scoured the forums and there's no reference to this bug... Any help would be MUCH appreciated.

Average of ratings: -
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok....

  1. There is no such icon 'slicon-settings' in Font Awesome 4.7.0.
  2. If you were mistakenly looking at Font Awesome 5 then 'slicon-settings' is not an icon in that too.
  3. Even if it was then you've missed a hyphen in the markup, i.e. should be: <i class="icon fa-slicon-settings fa-fw " aria-hidden="true"></i>

In reply to Gareth J Barnard

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers

Thanks very much for your reply.

Let me be more clear and detailed...  Using the default Boost theme without any customization at all, I'm seeing the same issue as in Adaptable and Fordson, so I presume this must be Boost-related.  I'm sure it's not the theme itself, but I can't figure out what else it could be.  Please see the attached screenshot to see what it looks like in dev tools.

There are a variety of fa icons that just don't load and leave an empty space (see pic).


Attachment boost-missing-fa-icons.PNG
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
I don't have Adaptable or Fordson installed, but I've just done a search on my dev Moodle on my laptop and don't find 'slicon' anywhere in Boost - or in that Moodle installation at all

Maybe a plugin with some javascript doing a replace and trying to put its own icon in for itself, but not properly limited and setting it across the site?
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok, I've done a complete search of all Moodle 3.7.2 that I have and the only place 'slicon-settings' exists as an image to icon translation within an extension of the 'icon_system_font' class is the Moove theme.
Average of ratings: Useful (2)
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers

I have done the same search and can't find anything anywhere that talks about slicon outside of the reference you already provided in Moove.... I really have no idea where to go from here...  How is it possible that this is even happening?  Moodle dosen't load parts of one theme and parts of another... right?

By contrast, when Moove is selected for the same course, the Settings wheel shows and here is the html...

Attachment moove-slicon.PNG
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok Garth, please could you post a screen shot of the issue where the theme is not Moove but the markup is that icon.

And just as critically, state Moodle and theme versions.

In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers
Moodle Version: 3.7.1 (20190824)
Boost Theme: 2019052000
Moove Theme: 3.7.0

Screenshot of missing 'settings' gear in Boost attached.  Thanks for the help!
Attachment boost-missing-settings-gear.PNG
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Odd as cannot replicate.
In reply to Gareth J Barnard

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Scrub that, I think you've found a bug with '$THEME->iconsystem'. So things are sorted when 'Purge all caches' (PAC). But.... critically iconsystem does not change when switching themes - thus any class it points to won't be changed unless a 'PAC'.
In reply to Gareth J Barnard

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok, scrub that too! The Moove theme is using the same icon mapping cache as Boost:

$cache = \cache::make('core', 'fontawesomeiconmapping');
therefore when PAC Boost's icon map is overwritten by Moove's and hence the issue.  It should be using its own cached icon map and returned by 'get_icon_name_map()'.  I did something similar in Shoelace in M3.6 for mapping FA 5 and yet still being able to switch themes.  Plus Moove has not additionally catered for the external AJAX calls too.

Thus, summary = Moove theme bug.
In reply to Gareth J Barnard

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers
I see... I REALLY appreciate you investigating this...

We were noticing that Adaptable & Fordson share this problem as well...

Can you please tell me how to resolve it? Is there a core Moove file I can alter? We use Moove as our default theme but give teachers the option to use Fordson and Adaptable as well.
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Garth,

Ok, both Adaptable and Fordson have the problem because they are child themes of Boost.
The solution is for Willian to fix the code in Moove - https://moodle.org/plugins/theme_moove - using the example code I've already done in Shoelace for M3.6 - https://moodle.org/plugins/theme_shoelace.
Or Adaptable and Fordson implement a different cache, but why should they when the issue is with the Moove theme?
Or I provide detailed instructions / code on how to fix the Moove theme. However, this is not trivial and would take a reasonable amount of time and I would want to be compensated for such.
Or you could patch Moove yourself using the code in Shoelace and what I've said already is the problem and why.

Kind regards,

Gareth
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers
Thanks so much for your thoughts Gareth. Your comments and helpfulness are VERY much appreciated. I'm very hopeful Willian will patch Moove as it's so well regarded on various referral sites.
In reply to Gareth J Barnard

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers
For anyone else who has this issue, here's a workaround that seems to consistently restore other Boost-child theme's FA icons:

***for testing, set a course's default theme to Boost (you should be missing a Course Settings gear among other FA icons as this is the bug we're dealing with)

Process:
  - switch Site default theme to Boost
  - In your filesystem -> moodleInstallationDirecotry/theme rename 'moove' to '-moove'
  - load moodle.ddsb.ca/moodle/admin/index.php in a new tab and click 'upgrade Database'
  ***Icons show up again if you view the course with a default Boost theme
  - Rename '-moove' back to 'moove'
  - load moodle.ddsb.ca/moodle/admin/index.php and click 'upgrade Database'
  - Switch the site default theme back to Moove
  - Click Clear Theme Caches
  ***Presto!***

Note: Installing/Uninstalling Adaptable produces the issue consistently (likely, any Boost child theme will do this).  As is mentioned by the super helpful Gareth, this is a 'Moove' theme issue, not an Adaptable/Fordson theme problem.
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Garth,

Umm, ok, process is overkill.  All you need to do after switching from Moove to Boost or Adaptable or Fordson is a 'Purge all caches' and the icons will come back.

Gareth

In reply to Gareth J Barnard

Re: fontawesome nothing "slicon" shows in themes

by Garth Brady -
Picture of Particularly helpful Moodlers
Unfortunately, not... I've tried the simple PAC and that does not work. For some reason, tripping the db  update is required to make the icons come back.
In reply to Garth Brady

Re: fontawesome nothing "slicon" shows in themes

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

That's odd then given how it works.  Ok in your procedure if you replace the DB upgrade with PAC then I would have thought that would do the job.

Q: Are there course / category themes turned on in the settings here?