Plugins cannot be uninstalled

Bug #505732 reported by Evan Goldenberg
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Mahara
Confirmed
Wishlist
Unassigned

Bug Description

Plugins cannot be completely removed from Mahara. They can only be enabled/disabled via the Administer Extensions page. A plugin could presumably be removed completely with some SQL hacking, but a feature should be added that does this when needed.

Revision history for this message
Evan Goldenberg (naveg) wrote :

After some more thinking and code inspection (mostly regarding blocktype plugins), here is my conclusion:

Completely removing a plugin from the database would involve wiping out all user data associated with that plugin (block instances, etc). This is probably not desirable. User data should be preserved so that the plugin can be installed again at a later date. This basically what the "disable" feature does - effectively removes the plugin from the site as far as users are concerned, but keeps all their data.

So, this feature would likely be used mostly, if not only, by developers working on new plugins, who need to start from scratch. Not very high priority, since they would typically know how to hack SQL as needed. Would still be a nice option, however.

Changed in mahara:
importance: Undecided → Wishlist
Changed in mahara:
importance: Wishlist → Medium
status: New → Confirmed
Changed in mahara:
importance: Medium → Low
Revision history for this message
Dominique-Alain JAN (dajan) wrote :

In fact, instead of delete completely the information from the database, the missing plugin should say in the block he is missing. On the page we keep the block and if the plugin to display the artefact is missing the string "To display this content, the plugin "pluginname" is required, but is missing on this Mahara installation. Please contact your administrator to fix it".

And by the way, the Site Administration->Manage Plugins page should not stall if the plugin is missing from the disk.

Aaron Wells (u-aaronw)
Changed in mahara:
importance: Low → Wishlist
Changed in mahara:
assignee: nobody → Nigel Cunningham (nigelc-g)
status: Confirmed → In Progress
Changed in mahara:
milestone: none → 15.04.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 15.04.0 → 15.04.1
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 15.04.1 → 15.10.0
Revision history for this message
Aaron Wells (u-aaronw) wrote :

I think we have to give site admins the power to shoot themselves in the foot if they want to. The uninstall *should* delete all the content from the database (maybe you're removing it to try to reduce the size of your database), dataroot, everything.

The easiest thing to do, is to go through install.xml and delete all the tables generated for the plugin. We would also need to go through all the tables for that plugin type (such as {plugin}_cron, etc) and delete content from those.

On top of that, each plugin will need to have a "post_uninstall()" optional method (and maybe a "pre_uninstall()" as well) for custom de-installation code.

The trickiest part of this, would be dealing with serialized block data, which occasionally contains references to other plugin types. That's the kind of thing the post_uninstall() method would have to deal with.

I also think, for the sake of our sanity, it might be best to prevent the core plugins from being uninstalled. They have been written with the assumption of permanence since day 1 and there are many hacky references to their existence scattered throughout the codebase (like the code that adds unique message thread ids to interaction/forum emails). So there's probably a lot of potential for crashes if you delete core plugins.

Revision history for this message
Dominique-Alain JAN (dajan) wrote :

Following our discussion of last Mahara Hui NZ, I think Mahara should provide programmers a function to call for the removing of their plugin. They then can override or surcharge what Mahara will do itself with some other work the plugin should do when deleted.

What do you think about that?

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Dominique,

Yep, that's pretty much what I was describing with my last comment. :)

Cheers,
Aaron

Revision history for this message
Dominique-Alain JAN (dajan) wrote :

Sorry I missed that paragraph.

My mistake. Culpa culpa maxima culpa

-dajan

Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 15.10.0 → none
Changed in mahara:
assignee: Nigel Cunningham (nigelc-g) → nobody
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.