Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-38259 No way to uninstall some plugin types
  3. MDL-39087

Improve plugin_manager to be able to uninstall all plugin types

    Details

    • Testing Instructions:
      Hide

      Testing difficulty: easy

      1. Install some add-on into your site, preferably using the new Install add-on admin tool.
      2. Visit Site administration ► Plugins ► Plugins overview
      3. TEST: Make sure there is the link 'Uninstall' displayed for the add-on and that it works (i.e. the add-on can be uninstalled).

      Notes:

      • The 'Uninstall' link should never appear for plugins that are required by some other plugins.
      • Plugins that do not have their own uninstallation script should be uninstalled by admin/plugins.php. This new common tool is also able to delete the plugin folder from the disk if the web server process has required write access. This applies only to plugins that do not have their own uninstall script (there is a separare issue for that). So for example, if you install a theme via the web interface, you should be also able to remove it completely via the web interface too.
      Show
      Testing difficulty: easy Install some add-on into your site, preferably using the new Install add-on admin tool. Visit Site administration ► Plugins ► Plugins overview TEST: Make sure there is the link 'Uninstall' displayed for the add-on and that it works (i.e. the add-on can be uninstalled). Notes: The 'Uninstall' link should never appear for plugins that are required by some other plugins. Plugins that do not have their own uninstallation script should be uninstalled by admin/plugins.php. This new common tool is also able to delete the plugin folder from the disk if the web server process has required write access. This applies only to plugins that do not have their own uninstall script (there is a separare issue for that). So for example, if you install a theme via the web interface, you should be also able to remove it completely via the web interface too.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-39087-plugins-uninstall

      Description

      • A new common tool for uninstalling general (any) plugin is needed.
      • Plugins overview screen must be improved so that it offers 'Uninstall' links only when it is appropriate (e.g. we can't uninstall a plugin that other plugins rely on).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              mudrd8mz David Mudrák added a comment -

              Submitting for integration. This has been peer-reviewed by Tim Hunt in the parent issue and the result has been reflected.

              Show
              mudrd8mz David Mudrák added a comment - Submitting for integration. This has been peer-reviewed by Tim Hunt in the parent issue and the result has been reflected.
              Hide
              mudrd8mz David Mudrák added a comment -

              Oops, some problems detected yet.

              Show
              mudrd8mz David Mudrák added a comment - Oops, some problems detected yet.
              Hide
              mudrd8mz David Mudrák added a comment -

              Done. Uff.

              Show
              mudrd8mz David Mudrák added a comment - Done. Uff.
              Hide
              poltawski Dan Poltawski added a comment -

              This is pretty big to arrive so late in Freeze. I'm holding it for now, but feel free to campaign to get it unfrozen.

              Show
              poltawski Dan Poltawski added a comment - This is pretty big to arrive so late in Freeze. I'm holding it for now, but feel free to campaign to get it unfrozen.
              Hide
              mudrd8mz David Mudrák added a comment -

              Well, the patch is pretty big because I wanted to solve the issue correctly (with unit tests etc) instead of some quick post-freeze hacks. And in a way that fits the long term plans with plugin management. Given the fact that 2.5 makes it easy to install new plugins easily, I believe that the ability to uninstall all installed add-ons is crucial for 2.5. Without it, one can easily find themselves in a trap of having an add-on installed for testing and then without a way to uninstall it. This will also allow us to fix serious issues like MDL-38591.

              Show
              mudrd8mz David Mudrák added a comment - Well, the patch is pretty big because I wanted to solve the issue correctly (with unit tests etc) instead of some quick post-freeze hacks. And in a way that fits the long term plans with plugin management. Given the fact that 2.5 makes it easy to install new plugins easily, I believe that the ability to uninstall all installed add-ons is crucial for 2.5. Without it, one can easily find themselves in a trap of having an add-on installed for testing and then without a way to uninstall it. This will also allow us to fix serious issues like MDL-38591 .
              Hide
              gb2048 Gareth J Barnard added a comment -

              Whats the issue for the uninstall script / where can I find details of how to write one please?

              Show
              gb2048 Gareth J Barnard added a comment - Whats the issue for the uninstall script / where can I find details of how to write one please?
              Hide
              skodak Petr Skoda added a comment -

              +1

              Show
              skodak Petr Skoda added a comment - +1
              Hide
              mudrd8mz David Mudrák added a comment -

              Gareth: what I meant was MDL-39088. Instructions on writing plugin and/or plugin-type uninstall code will be prepared while working on it.

              Show
              mudrd8mz David Mudrák added a comment - Gareth: what I meant was MDL-39088 . Instructions on writing plugin and/or plugin-type uninstall code will be prepared while working on it.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              +0.7

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - +0.7
              Hide
              mudrd8mz David Mudrák added a comment -

              BTW, note that if you ignore added unit tests, the patchset is not that big at the end...

              admin/courseformats.php | 3 +-
              admin/plugins.php | 101 +++++++++++++++++-
              admin/renderer.php | 109 ++++++++++++++++---
              lang/en/plugin.php | 5 +
              lib/adminlib.php | 13 ++-
              lib/editor/tinymce/adminlib.php | 5 +
              lib/editor/tinymce/settings.php | 3 +-
              lib/filestorage/file_storage.php | 16 +++
              lib/filestorage/tests/file_storage_test.php | 11 ++
              lib/pluginlib.php | 473 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
              lib/tests/fixtures/mockplugins/mod/bar/version.php | 4 +
              lib/tests/fixtures/mockplugins/mod/baz/meg/one/version.php | 5 +
              lib/tests/fixtures/mockplugins/mod/baz/version.php | 4 +
              lib/tests/fixtures/mockplugins/mod/foo/lish/frog/version.php | 6 ++
              lib/tests/fixtures/mockplugins/mod/foo/lish/hippo/version.php | 6 ++
              lib/tests/fixtures/mockplugins/mod/foo/version.php | 10 ++
              lib/tests/fixtures/mockplugins/mod/qux/cat/one/version.php | 6 ++
              lib/tests/fixtures/mockplugins/mod/qux/version.php | 5 +
              lib/tests/pluginlib_test.php | 391 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
              lib/upgrade.txt | 9 ++
              theme/base/style/admin.css | 6 +-
              theme/bootstrap/less/moodle/admin.less | 5 +-
              22 files changed, 1126 insertions, 70 deletions

              Show
              mudrd8mz David Mudrák added a comment - BTW, note that if you ignore added unit tests, the patchset is not that big at the end... admin/courseformats.php | 3 +- admin/plugins.php | 101 +++++++++++++++++- admin/renderer.php | 109 ++++++++++++++++--- lang/en/plugin.php | 5 + lib/adminlib.php | 13 ++- lib/editor/tinymce/adminlib.php | 5 + lib/editor/tinymce/settings.php | 3 +- lib/filestorage/file_storage.php | 16 +++ lib/filestorage/tests/file_storage_test.php | 11 ++ lib/pluginlib.php | 473 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- lib/tests/fixtures/mockplugins/mod/bar/version.php | 4 + lib/tests/fixtures/mockplugins/mod/baz/meg/one/version.php | 5 + lib/tests/fixtures/mockplugins/mod/baz/version.php | 4 + lib/tests/fixtures/mockplugins/mod/foo/lish/frog/version.php | 6 ++ lib/tests/fixtures/mockplugins/mod/foo/lish/hippo/version.php | 6 ++ lib/tests/fixtures/mockplugins/mod/foo/version.php | 10 ++ lib/tests/fixtures/mockplugins/mod/qux/cat/one/version.php | 6 ++ lib/tests/fixtures/mockplugins/mod/qux/version.php | 5 + lib/tests/pluginlib_test.php | 391 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- lib/upgrade.txt | 9 ++ theme/base/style/admin.css | 6 +- theme/bootstrap/less/moodle/admin.less | 5 +- 22 files changed, 1126 insertions , 70 deletions
              Hide
              dougiamas Martin Dougiamas added a comment -

              I like it and I trust David and Tim to have tested it well. I agree it's a forgotten part of the new install feature so my +1 for it.

              Show
              dougiamas Martin Dougiamas added a comment - I like it and I trust David and Tim to have tested it well. I agree it's a forgotten part of the new install feature so my +1 for it.
              Hide
              poltawski Dan Poltawski added a comment -

              Integrated, thanks David

              Show
              poltawski Dan Poltawski added a comment - Integrated, thanks David
              Hide
              poltawski Dan Poltawski added a comment -

              Tested with mod and a theme. The mod could be removed and didn't remove code, the theme did.

              Confirmed that depdendent versions couldn't be removed, even by manipulating the url. However, I noticed the mod uninstallation would do it, so it would be good to move all modules to this with stricter checking!

              Show
              poltawski Dan Poltawski added a comment - Tested with mod and a theme. The mod could be removed and didn't remove code, the theme did. Confirmed that depdendent versions couldn't be removed, even by manipulating the url. However, I noticed the mod uninstallation would do it, so it would be good to move all modules to this with stricter checking!
              Hide
              poltawski Dan Poltawski added a comment -

              Blooming Marvelous! It's time for a knees up - your changes are upstream!

              Thanks for making Moodle better!

              Toodle pip

              Show
              poltawski Dan Poltawski added a comment - Blooming Marvelous! It's time for a knees up - your changes are upstream! Thanks for making Moodle better! Toodle pip
              Hide
              marycooch Mary Cooch added a comment -

              Removing docs_required as this is covered in http://docs.moodle.org/25/en/Installing_add-ons

              Show
              marycooch Mary Cooch added a comment - Removing docs_required as this is covered in http://docs.moodle.org/25/en/Installing_add-ons

                People

                • Votes:
                  6 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13