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

Lock theme selector UI when $CFG->theme is hardcoded in config.php

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.9.2, 3.0
    • Fix Version/s: 3.0
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      Theme Selector

      This test is to check that the changes to the theme selector UI worked correctly.

      1. Modify your config.php (in your root moodle install directory) and set a theme property on the $CFG object, e.g. $CFG->theme = 'clean'
      2. Log in as admin
      3. Go to the theme selector
        • Site administration > Appearance > Themes > Theme Selector
      4. Confirm that you still have the "clear themes cache" button
      5. Confirm that you are told that the theme has already been configured (should say "Defined in config.php") and it's locked for changes.
      6. Modify your config.php again and add $CFG->thememobile = 'clean' or $CFG->thememobile = 'more'
      7. View the theme selector again
      8. Confirm that now the row for the mobile theme is also locked and that it matches the config you set, showing the "Defined in config.php" message.
      9. Confirm that you are not able to change any of the locked devices (have a look at theme/index.php source code and try sending different params to the page to trigger a theme change)
      10. Confirm the unlocked devices do continue working (set, change, unset).

      Course and Course category Themes

      This test it to check that you can still set course/coursecat level theme overrides while the overall site theme is locked.

      1. Make sure you've got theme set in your config.php (as above)
      2. Enable course/coursecat theme settings (allowcoursethemes, allowcategorythemes)
      3. Edit a course/coursecat and change the theme to a different one.
      4. Save and view the course and confirm that the correct theme is used.

      User Themes

      This test it to check that you can still set user while the overall site theme is locked.

      1. Make sure you've got theme set in your config.php (as above)
      2. Enable course/coursecat theme settings (allowuserthemes)
      3. Go to your profile and change theme to a different one.
      4. Save and view that, from that moment, you always get the user theme used instead of the locked one.

      URL Themes

      This test it to check that you can still set theme overrides via URL.

      1. Make sure you've got theme set in your config.php (as above)
      2. Enable url theme change (allowthemechangeonurl)
      3. Go anywhere in your site and add &theme=someothertheme and verify the theme changes accordingly.
      Show
      Theme Selector This test is to check that the changes to the theme selector UI worked correctly. Modify your config.php (in your root moodle install directory) and set a theme property on the $CFG object, e.g. $CFG->theme = 'clean' Log in as admin Go to the theme selector Site administration > Appearance > Themes > Theme Selector Confirm that you still have the "clear themes cache" button Confirm that you are told that the theme has already been configured (should say "Defined in config.php") and it's locked for changes. Modify your config.php again and add $CFG->thememobile = 'clean' or $CFG->thememobile = 'more' View the theme selector again Confirm that now the row for the mobile theme is also locked and that it matches the config you set, showing the "Defined in config.php" message. Confirm that you are not able to change any of the locked devices (have a look at theme/index.php source code and try sending different params to the page to trigger a theme change) Confirm the unlocked devices do continue working (set, change, unset). Course and Course category Themes This test it to check that you can still set course/coursecat level theme overrides while the overall site theme is locked. Make sure you've got theme set in your config.php (as above) Enable course/coursecat theme settings (allowcoursethemes, allowcategorythemes) Edit a course/coursecat and change the theme to a different one. Save and view the course and confirm that the correct theme is used. User Themes This test it to check that you can still set user while the overall site theme is locked. Make sure you've got theme set in your config.php (as above) Enable course/coursecat theme settings (allowuserthemes) Go to your profile and change theme to a different one. Save and view that, from that moment, you always get the user theme used instead of the locked one. URL Themes This test it to check that you can still set theme overrides via URL. Make sure you've got theme set in your config.php (as above) Enable url theme change (allowthemechangeonurl) Go anywhere in your site and add &theme=someothertheme and verify the theme changes accordingly.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull Master Branch:
      MDL-51739-master-individual-locking

      Description

      When themes are set and hardcoded in config.php (as in MoodleCloud) then theme selection script should:

      a) Not list other themes
      b) Not allow you change to other themes.

      So just modify the main theme page to have:

      Your theme has been defined in config.php as "XXXXX".

      And then show the preview thing below, with the settings link if it has one.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  16/Nov/15