Need to fix copy page/collection where the original page has obsolete blocks

Bug #1482384 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Robert Lyon

Bug Description

If a user has a page / collection that contains blocks for blocktype plugins that don't exist on the server anymore it causes the copying to fail as certain functions can't be found during the copying process.

There needs to be a step where the copy process either:

1) Not copy any plugin blocks where the plugin is not active, or

2) Check to see if the version.php file still exists for the plugin first and not copy any blocks where it doesn't, or

3) Have the table column that keeps track of the 'active' status of blocktype plugins to also have the option of '-1' to indicate not active and also files missing (this info could also be displayed on the Admin -> Extensions screen as well) so that the copy process ignores blocks with active status = -1

Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 15.10.0 → 16.04.0
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/5874

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5874
Committed: https://git.mahara.org/mahara/mahara/commit/61eb47060093f8f255542e6c8a160e2b428286cf
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 61eb47060093f8f255542e6c8a160e2b428286cf
Author: Robert Lyon <email address hidden>
Date: Wed Jan 6 12:57:31 2016 +1300

Bug 1482384: Ingoring obsolete blocks when copying

If when copying a page it has a block on it where the underlying mahara php
files for the block are missing/unreadable it will be ignored (not
copied) rather than cause a fatal error.

behatnotneeded

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

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

Easiest way to test this, if you're running Mahara from git, is to use "git checkout" to pull out a copy of the contactinfo block, and remove it once you're ready.

1. Install Mahara (from git)
2. Grab the code for the contactinfo blocktype: git checkout b5c9e316329eca254841783acbd0b7a5177d0349~ -- htdocs/artefact/internal/blocktype/contactinfo
3. Go to Administration -> Extensions and tell Mahara to install the "new" contactinfo blocktype.
4. Put a contact info block into a page. Set the page to copyable.
5. Remove the blocktype's code by doing: git stash
6. Try to copy the page.

Changed in mahara:
status: In Progress → Fix Committed
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.