Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70106

Fontawesome icon system local caching can cause missing icons

XMLWordPrintable

    • MOODLE_310_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70106-icon-cache
    • Hide

      Setup

      1. Install a theme for testing, which forces every icon to be a folder:

        git clone git@github.com:Peterburnett/MDL-70106-tester.git theme/boosticonsbroken
        

      2. Login as admin.
      3. Perform the upgrade to install the cloned broken theme.
      4. Access to "Site administration / Appearance / Themes / Theme selector" and set the site Default theme to 'Boosticonsbroken'.
      5. Go to "Appearance / Themes / Theme settings" and set 'allowcoursethemes' on.
      6. Create a test course, and set the 'Force theme' control in the appearance tab to 'Boost'.

       

      Testing instructions

      1. Go to "Site administration / Development / Purge caches" and purge caches.
      2. Verify the status of the localstorage cache (Firefox instructions):
        • Open the browser devtools using F12
        • Click the storage tab, expand the 'Local Storage' Menu item, and click the test server domain.
        • In the 'Filter items' bar, enter 'iconmap'.
        • Confirm that the 'iconmap' entry key contains the theme for the iconmap: core_iconsystem/theme/boosticonsbroken/iconmap-fontawesome
      3. Access to the course and enable editing mode.
      4. Verify that icons that are loaded by JS, such as the move handles on activities, appear correctly (so they are not a folder icon).
      5. Open the browser localstorage menu and verify that there are now two iconmaps in the localstorage cache, one for boosticonsbroken and another for boost, that contains the correct mappings.

       

      Show
      Setup Install a theme for testing, which forces every icon to be a folder: git clone git@github.com:Peterburnett/MDL-70106-tester.git theme/boosticonsbroken Login as admin. Perform the upgrade to install the cloned broken theme. Access to "Site administration / Appearance / Themes / Theme selector" and set the site Default theme to 'Boosticonsbroken'. Go to "Appearance / Themes / Theme settings" and set 'allowcoursethemes' on. Create a test course, and set the 'Force theme' control in the appearance tab to 'Boost'.   Testing instructions Go to "Site administration / Development / Purge caches" and purge caches. Verify the status of the localstorage cache (Firefox instructions): Open the browser devtools using F12 Click the storage tab, expand the 'Local Storage' Menu item, and click the test server domain. In the 'Filter items' bar, enter 'iconmap'. Confirm that the 'iconmap' entry key contains the theme for the iconmap: core_iconsystem/theme/boosticonsbroken/iconmap-fontawesome Access to the course and enable editing mode. Verify that icons that are loaded by JS, such as the move handles on activities, appear correctly (so they are not a folder icon). Open the browser localstorage menu and verify that there are now two iconmaps in the localstorage cache, one for boosticonsbroken and another for boost, that contains the correct mappings.  

      When using two themes in the system, for example, a main theme, and a forced course or user theme, if both these themes declare a new icon system mapping, based on fontawesome, the caching can become incorrect. The localstorage cache for core/pix_icon_fontawesome can be incorrect. This cache is not stored with any particular theme, just the themerev and jsrev.

      If you clear all caches, and load theme1, then visit a course that forces theme2, the theme1 iconmapping will be applied to the theme2 page. This can lead to incorrect mappings, or even missing icons.

            peterburnett Peter Burnett
            peterburnett Peter Burnett
            Brendan Heywood Brendan Heywood
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ilya Tregubov Ilya Tregubov
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 15 minutes
                2h 15m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.