Migrate PluginArtefactMultirecipientnotification to a Module plugintype instead

Bug #1468156 reported by Aaron Wells
6
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 multirecipientinboxnotification to that type.

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

I believe the steps involved will be basically this (but maybe not in this order):

1. Move the files from htdocs/artefact/multirecipientnotification to htdocs/module/multirecipientnotification. Likewise relocate any theme and/or lang files.

2. Rename the PluginArtefactMultirecipientnotification class to PluginModuleMultirecipientnotification 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/multirecipientnotification, and rewrite them to refer to the new location module/multirecipientnotification

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.

Revision history for this message
Tobias Zeuch (tobias-zeuch-8) wrote :

If no one has started working on this yet, I'd like to take care of it.

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

Hi Tobias,

Go for it!

Cheers,
Aaron

Changed in mahara:
assignee: nobody → Tobias Zeuch (tobias-zeuch-8)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4920

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4920
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/dd0e1dab78a50239829e8605f5623519b70b0f09
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit dd0e1dab78a50239829e8605f5623519b70b0f09
Author: Tobias Zeuch <email address hidden>
Date: Sun Jul 5 11:22:45 2015 +0200

Bug 1468156: Change plugin type of plugin multirecipientnotification to module

To change the plugin type from artefact to module, the code is moved and the
superclass reference is changed to PluginModule. Obsolete classes for the
former unused artefact types are deleted. The references to the old script
paths are changed. Plugin Tables are renamed and references updated.
The new plugin mustn't be installed when the old plugin is still active, but on
upgrade, the database tables are renamed and references in artefact_installed
and artefact_event_subscription and the triggers are changed.

Change-Id: Id5f1198b780ffb92181f7d60785aad9ffe2259da
Signed-off-by: Tobias Zeuch <email address hidden>

Aaron Wells (u-aaronw)
Changed in mahara:
status: Confirmed → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5007

Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

Hi,

I've been playing with this one testing it a bit but let me know what cases you specifically want me to run through.

Cheers,
Jinelle

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5007
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/33c50f16def958e512e7fbb4051cabc28286fa55
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 33c50f16def958e512e7fbb4051cabc28286fa55
Author: Yuliya Bozhko <email address hidden>
Date: Fri Jul 24 13:45:43 2015 +0100

Fix upgrade error (Bug 1468156)

Change-Id: I097a9f3cb0bf9e227cc30350b053b45351286624
Signed-off-by: Yuliya Bozhko <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5028

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5028
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/8df4773f7c88a4405dc4bb08bfda7c6cfd61f5fb
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 8df4773f7c88a4405dc4bb08bfda7c6cfd61f5fb
Author: Robert Lyon <email address hidden>
Date: Fri Jul 31 16:34:52 2015 +1200

Bug 1468156: Inbox blocktype needs to check module now

Since we moved multirecipientnotifications from artefact to module we
should now check there for it :)

Change-Id: If224ca1f323cd39d619b56a7cd1a1373afdaa04d
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5140

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/5208

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5208
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/30fe96269e5a3e5ef726948c84bfc531624241ff
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 30fe96269e5a3e5ef726948c84bfc531624241ff
Author: Robert Lyon <email address hidden>
Date: Thu Sep 3 19:41:21 2015 +1200

Bug 1468156: Missed 'artefact' to 'module' text changes

When multirecipientnotification plugin was changed

behatnotneeded

Change-Id: I90e60f939ab4e04b871d7be309a5184e5aa747ac
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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