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

Uninstall theme unconditionally unsets configs

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Use case 1:

      1. Choose a theme that you can uninstall. Let's call this theme DeleteMe
      2. Set a course to DeleteMe theme.
      3. Set a course category to DeleteMe theme.
      4. Set a user to DeleteMe theme.
      5. Set a mnet_host record to DeleteMe theme. (Unsure how to do this, might have to manually create the record).
      6. Go to Site administration / Appearance / Themes / Theme selector
      7. Set mobile, tablet and legacy device types to DeleteMe theme.
      8. Uninstall DeleteMe theme.
      9. Expected, the course, category, user, mnet record and device types should all be unset from the DeleteMe theme.

      Use case 2:

      1. Choose a theme that you can uninstall. Let's call this theme DeleteMe
      2. Go to Site administration / Appearance / Themes / Theme selector
      3. Set mobile, tablet and legacy device types to any theme besides the DeleteMe theme.
      4. Uninstall DeleteMe theme.
      5. Expected, the device type theme selections should be unchanged.
      Show
      Use case 1: Choose a theme that you can uninstall. Let's call this theme DeleteMe Set a course to DeleteMe theme. Set a course category to DeleteMe theme. Set a user to DeleteMe theme. Set a mnet_host record to DeleteMe theme. (Unsure how to do this, might have to manually create the record). Go to Site administration / Appearance / Themes / Theme selector Set mobile, tablet and legacy device types to DeleteMe theme. Uninstall DeleteMe theme. Expected, the course, category, user, mnet record and device types should all be unset from the DeleteMe theme. Use case 2: Choose a theme that you can uninstall. Let's call this theme DeleteMe Go to Site administration / Appearance / Themes / Theme selector Set mobile, tablet and legacy device types to any theme besides the DeleteMe theme. Uninstall DeleteMe theme. Expected, the device type theme selections should be unchanged.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-46013_uninstall_theme

      Description

      The core\plugininfo\theme::uninstall_cleanup() method unconditionally deletes these configs:

      unset_config('thememobile');
      unset_config('themetablet');
      unset_config('themelegacy');
      

      I'm assuming that the values should be checked to see if the value is set to the name of the theme that is being deleted.

      Other items that could be cleaned as well:

      • themelist config value has a CSV of theme names.
      • theme config value could be set to the theme being uninstalled. I forget what the default theme is, but should probably be set to that. Never mind, just saw that the plugin code prevents you from uninstalling the default theme.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14