Migrate PluginArtefactMultirecipientnotification to a Module plugintype instead
Bug #1468156 reported by
Aaron Wells
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Tobias Zeuch | ||
15.10 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The new Inbox was a third-party contribution authored by Tobias and graciously shared with the community. Unfortunately, it's a bit hacky that it was implemented as an artefact, since it does not provide any artefact functionality (i.e. no entities that are meant to be displayed via blocks in a portfolio Page).
I understand the reason it was done that way, was because Tobias wanted to write it as a plugin (since he first wrote it for his own use and didn't want to hack the core), and the generic "module" plugin type wasn't yet available when he wrote it. But now that we have the "module" plugin type, we should really migrate the multirecipienti
Changed in mahara: | |
status: | Confirmed → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I believe the steps involved will be basically this (but maybe not in this order):
1. Move the files from htdocs/ artefact/ multirecipientn otification to htdocs/ module/ multirecipientn otification. Likewise relocate any theme and/or lang files.
2. Rename the PluginArtefactM ultirecipientno tification class to PluginModuleMul tirecipientnoti fication and make it extend PluginModule instead of PluginArtefact. Remove any unneeded PluginArtefact methods from the class.
3. Find all URLs and paths that reference artefact/ multirecipientn otification, and rewrite them to refer to the new location module/ multirecipientn otification
4. Force the new module plugin to be installed during system upgrade.
5. Copy the content from the old artefact's tables to the new module's tables. Or maybe just rename the tables? That would probably be faster. Although it would conflict with the tables auto-generated by the install.xml. Perhaps in the module's post_inst() method you could check for the artefact tables, and if they exist, drop the module tables and then rename the artefact tables to become the new module tables.
6. Drop the old artefact's triggers, and recreate them against the new module tables.
5. Delete any other lingering references to the plugin, from the database. It'll be in the "artefact_ installed" table for instance.