Blocks lost when importing a leap2a from mahara.org

Bug #1229563 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Son Nguyen
1.7
Fix Released
Medium
Son Nguyen

Bug Description

When I export my account from mahara.org to a leap2a file, and then try to import it into a clean Mahara 1.7 installation, I find that it creates all the pages, but some of the Pages are missing their blocks, or their block content.

The problem seems to be because it's processing the leap.xml file sequentially from top to bottom. The artefacts that cause problems are listed further down in the XML file than the View they are used in. When the View is processed, it can't find the artefacts, and so it drops their blocks.

Leap2a import should be fully backwards-compatible, and it should definitely work with Leap2a files from mahara.org itself, given how prominent a site that is. The solution would seem to be to come up with some way to make it less dependent upon the order that the items are in the XML file. Perhaps more cacheing, so that it doesn't have to map in the leap2a-IDs to real ones until the very end? Or maybe just cache the ones that have an ID that it isn't able to resolve?

I suspect this will not be a trivial issue to fix. The simplest thing we can do is to change our export format so that it puts artefacts first, but that won't solve for backwards compatibility. We should also take care that any solution is at least somewhat cross-platform compatible. So, for instance, parsing out all those that have a <mahara:artefactplugin> first, would probably be a bad idea because that's a Mahara extension to leap2a and won't solve this problem for leap2a's coming from other sources.

Tags: leap2a
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: none → 1.7.3
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Which blocks were affected, Aaron? Just so we know what to watch out for testing.

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

I've attached my mahara.org leap2a export so that other people can test with it. All the blocks were missing from the Pages I created, although I think my Dashboard and Profile weren't affected. So, it's probably just "Artefact Blocks" that go missing, since the Dashboard and Profile mostly display blocks that aren't dependent on a particular artefact.

The types of blocks on my pages, which went missing, include:

Text
Files to download
Image

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

I also tested Son's leap2a import using this same leap2a file, and reported basically the same issue, which I think he has since fixed! So this problem may be fixed by his patches for leap2a import.

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

When I manually edit the leap.xml file to move all my artefacts up above my views, then zip that up and import it, everything works fine and all my Pages come through with all their blocks.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Aaron, this sounds similar to what Bob found with the attachments on notes. The files needed to come first in the Leap2A file before the note creation so that they could be attached properly.

Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.7.3 → none
Revision history for this message
Son Nguyen (ngson2000) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2625
Committed: http://gitorious.org/mahara/mahara/commit/e67644c0f130ca4dc413bed8cf16c337be57caae
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit e67644c0f130ca4dc413bed8cf16c337be57caae
Author: Son Nguyen <email address hidden>
Date: Thu Oct 17 21:43:07 2013 +1300

Fix blocks lost when importing leap2a (Bug #1229563)

1. Fix Leap2a export audio and video file
2. Fix text box leap2a import

Change-Id: I6f9f6d082f3796cf74ff134bc632c47e3abf3a63
Signed-off-by: Son Nguyen <email address hidden>

Aaron Wells (u-aaronw)
no longer affects: mahara/1.8
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2666
Committed: http://gitorious.org/mahara/mahara/commit/cd684a971df5d60b1c1e91171e683aa4b23f49bb
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.7_STABLE

commit cd684a971df5d60b1c1e91171e683aa4b23f49bb
Author: Son Nguyen <email address hidden>
Date: Thu Oct 17 21:43:07 2013 +1300

Fix blocks lost when importing leap2a (Bug #1229563)

1. Fix Leap2a export audio and video file
2. Fix text box leap2a import

Change-Id: I6f9f6d082f3796cf74ff134bc632c47e3abf3a63
Signed-off-by: Son Nguyen <email address hidden>

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.