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

theme_build_css_for_themes does not work for clusters

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Edit lib/outputlib.php and add a 10 second sleep to the end of the function "get_css_content()", right before the "return" statement:

            public function get_css_content() { 
                  ...                                                                                                                                                                                    
                  sleep(10);                                                                                                                  
                  return $csscontent;                                                                                                         
              }                       
        

      2. Login as admin
      3. Navigate to "Site administration / Appearance / Themes / Theme settings"
      4. Make sure the setting "Theme designer mode" is disabled.
      5. Go to: /admin/settings.php?section=themesettingboost
      6. Change the "Brand color" to something garish (pink works!). 
      7. Save the changes.
      8. Verify you see (garish colour) text here and there.
      9. From the command line, run these commands in your moodle root folder:

        php admin/cli/purge_caches.php
         
        php admin/cli/build_theme_css.php
        

      10. Now change to your moodledata folder and run this command:

        rm -rf localcache
        

      11. Now reload the page in the web browser.
        • Confirm that it reloads "quickly" (we are checking that we did not have to rebuild the CSS).
        • Confirm that the page still shows the "garish" text colour (we are checking we didn't use the fallback CSS).
      12. Using your file browser, navigate to the moodledata folder.
        • Confirm that the "localcache" folder has re-appeared.
      13. Open the localcache folder.
        • Confirm that it contains a "theme" subdirectory (we are checking the CSS was promoted from MUC to localcache).
      Show
      Edit lib/outputlib.php and add a 10 second sleep to the end of the function "get_css_content()", right before the "return" statement: public function get_css_content() { ... sleep(10); return $csscontent; } Login as admin Navigate to " Site administration / Appearance / Themes / Theme settings " Make sure the setting "Theme designer mode" is disabled. Go to: /admin/settings.php?section=themesettingboost Change the "Brand color" to something garish (pink works!).  Save the changes. Verify you see (garish colour) text here and there. From the command line, run these commands in your moodle root folder: php admin/cli/purge_caches.php   php admin/cli/build_theme_css.php Now change to your moodledata folder and run this command: rm -rf localcache Now reload the page in the web browser. Confirm that it reloads "quickly" (we are checking that we did not have to rebuild the CSS). Confirm that the page still shows the "garish" text colour (we are checking we didn't use the fallback CSS). Using your file browser, navigate to the moodledata folder. Confirm that the " localcache " folder has re-appeared. Open the localcache folder. Confirm that it contains a "theme" subdirectory (we are checking the CSS was promoted from MUC to localcache).
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60925-master

      Description

      theme_build_css_for_themes builds the CSS and stores it in localcache ONLY. This means all the other nodes for the site do not have a copy of the theme and will build it again on first access.

      It's supposed to store it in MUC so it's available for all nodes, as well as localcache. On fetch it checks localcache, then MUC before finally rebuilding it as a last resort.

      It's also broken because it only pre-builds the theme for "nosvg". This version of the theme is only intended for non-supported browsers. We should just drop it.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                damyon Damyon Wiese
                Reporter:
                damyon Damyon Wiese
                Peer reviewer:
                Ryan Wyllie
                Integrator:
                Jun Pataleta
                Tester:
                Rayna Mae Jayco
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/Jan/18