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

Purge all caches only purges the selected cache if selected

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE
    • Hide

      Verify before start

      Ensure that, in your config.php, you don't have any line like this:

      $CFG->langstringcache = false;

      (comment out the whole line or change it from false to true)

      Steps

      1. Edit the 'purgecachespage' lang string in lang/en/admin.php to the following:

        $string['purgecachespage'] = 'Purge caches (Edited)';
        

      2. Log in as admin
      3. Navigate to Development > Purge caches in site administration
      4. Under Purge selected caches select Themes and press Purge selected caches
      5. Confirm you see the message "The selected caches were purged."
      6. Confirm the theme cache was purged (the name of the folder within <DATAROOT>/localcache/theme will reflect the time the cache was purged)
      7. Confirm the string cache was not purged (page heading should still read Purge caches)
      8. Ensure Purge selected caches > Themes is still checked
      9. Press Purge all caches
      10. Confirm you see the message "All caches were purged."
      11. Confirm the "Purge caches" heading has changed to "Purge caches (Edited)" (i.e. all caches were purged, not only the selected themes cache)
      Show
      Verify before start Ensure that, in your config.php, you don't have any line like this: $CFG->langstringcache = false; (comment out the whole line or change it from false to true) Steps Edit the 'purgecachespage' lang string in lang/en/admin.php to the following: $string['purgecachespage'] = 'Purge caches (Edited)'; Log in as admin Navigate to Development > Purge caches in site administration Under Purge selected caches select Themes and press Purge selected caches Confirm you see the message "The selected caches were purged." Confirm the theme cache was purged (the name of the folder within <DATAROOT>/localcache/theme will reflect the time the cache was purged) Confirm the string cache was not purged (page heading should still read Purge caches ) Ensure Purge selected caches > Themes is still checked Press Purge all caches Confirm you see the message "All caches were purged." Confirm the "Purge caches" heading has changed to "Purge caches (Edited)" (i.e. all caches were purged, not only the selected themes cache)

      On the 'Purge caches' page (/admin/purgecaches.php), if you tick one on the 'Purge selected caches' and then click on 'Purge all caches' then only the selected cache is purged.

       

      To replicate, add and use a new language string in a plugin, don't update its version and then find that its not know about when having only the 'Themes' cache tick box ticked and clicking on 'Purge all caches'.

      Only affects UI, CLI has a different 'interface'.

       

      Tested in 4.0dev+ (Build: 20211022), not sure if affects older versions.

        1. MDL-72908_master_Step 10-11.png
          MDL-72908_master_Step 10-11.png
          114 kB
        2. MDL-72908_master_Step 5 and 7.png
          MDL-72908_master_Step 5 and 7.png
          114 kB
        3. MDL-72908_master_Step 6.png
          MDL-72908_master_Step 6.png
          10 kB
        4. MDL-72908_Step 10-11.png
          MDL-72908_Step 10-11.png
          114 kB
        5. MDL-72908_Step 5 and 7.png
          MDL-72908_Step 5 and 7.png
          112 kB
        6. MDL-72908_Step 6.png
          MDL-72908_Step 6.png
          10 kB
        7. Screenshot 2021-10-25 170842.png
          Screenshot 2021-10-25 170842.png
          59 kB

            pholden Paul Holden
            gb2048 Gareth J Barnard
            Gareth J Barnard Gareth J Barnard
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 36 minutes
                36m

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