Issue Details (XML | Word | Printable)

Key: MDL-18469
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Eloy Lafuente (stronk7)
Reporter: Lucian DiPeso
Votes: 4
Watchers: 5
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Restores to an existing course can wipe out the course

Created: 07/Mar/09 08:25 AM   Updated: 06/Oct/09 12:42 PM
Return to search
Component/s: Backup
Affects Version/s: 1.9.4
Fix Version/s: 1.9.6

File Attachments: 1. Text File patch.patch (0.4 kB)

Environment: PHP 5.2.8, RedHat, Apache 2, MSSQL database running on IIS

Database: Microsoft SQL
Participants: Dongsheng Cai, Eloy Lafuente (stronk7), Lucian DiPeso and Petr Skoda
Security Level: None
QA Assignee: Dongsheng Cai
Difficulty: Moderate
Resolved date: 06/Oct/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
Sometimes, when I try to restore a course, and select "Existing course, adding data to it", the restore fails, throwing an error when it tries to restore users. This doesn't happen all the time, but more often than not.

The more serious issue is that when I try to back to a course after the restore has failed, it is completely wiped out. All the content and blocks were gone -- it was just a blank course.

I tracked down where the problem was, and the restore_execute() in backup/restorelib.php apparently wasn't able to find the XML file in the temp directory that is created from the zip file. For some reason, sometimes (but not always) Moodle loses the session data that stores the name of this directory.

What I did is to add a check closer to the top of the restore process, so that it can check to see if it can find the XML file before proceeding any further. A diff file is attached with the changes. This doesn't fix the problem, however, of Moodle "forgetting" where it stored the contents of the zip file. It also means that users may have to repeatedly attempt to restore a course for it to actually work.

I was unable to track down why Moodle is losing some of the $SESSION->restore object's data.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 02/Oct/09 08:47 PM
MDL-18469 Minor changes to restore silenty/import before implementing checksum
MODIFY backup/restorelib.php   Rev. 1.283.2.76    (+7 -4 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 02/Oct/09 08:50 PM
MDL-18469 Minor changes to restore silenty/import before implementing checksum. Merged from 19_STABLE
MODIFY backup/restorelib.php   Rev. 1.393    (+7 -4 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 05/Oct/09 06:23 PM
MDL-18469 restore missing session info - add a quick re-test of xml file
before any further processing by restore_execute(). More coming.
MODIFY backup/restorelib.php   Rev. 1.283.2.77    (+16 -4 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 05/Oct/09 06:31 PM
MDL-18469 restore missing session info - add a quick re-test of xml file
before any further processing by restore_execute(). More coming. Merged
from 19_STABLE
MODIFY backup/restorelib.php   Rev. 1.394    (+16 -4 lines)
Eloy Lafuente (stronk7) committed 3 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 06/Oct/09 01:21 AM
MDL-18469 checksum restore in-session objects - both in manual restore and
import, create checksums of the critical in-session objects (info, course_header
and restore) to be able to check in restore_execute.html that all the information
has arrived properly without any trim/error.
MODIFY backup/restore_execute.html   Rev. 1.62.4.4    (+16 -1 lines)
MODIFY backup/restorelib.php   Rev. 1.283.2.78    (+21 -1 lines)
MODIFY backup/restore_check.html   Rev. 1.48.2.18    (+6 -1 lines)
Eloy Lafuente (stronk7) committed 3 files to 'Moodle CVS' - 06/Oct/09 01:23 AM
MDL-18469 checksum restore in-session objects - both in manual restore and
import, create checksums of the critical in-session objects (info, course_header
and restore) to be able to check in restore_execute.html that all the information
has arrived properly without any trim/error. Merged from 19_STABLE
MODIFY backup/restore_execute.html   Rev. 1.70    (+16 -1 lines)
MODIFY backup/restore_check.html   Rev. 1.77    (+6 -1 lines)
MODIFY backup/restorelib.php   Rev. 1.395    (+21 -1 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 06/Oct/09 01:43 AM
MDL-18469 restore checksums - add error message string
MODIFY lang/en_utf8/error.php   Rev. 1.26.2.25    (+2 -1 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 06/Oct/09 01:45 AM
MDL-18469 restore checksums - add error message string. Merged from 19_STABLE
MODIFY lang/en_utf8/error.php   Rev. 1.207    (+2 -1 lines)
martignoni committed 1 file to 'Lang CVS' - 06/Oct/09 02:52 AM
MDL-18469 String translated for restore checksums
MODIFY fr_utf8/error.php   Rev. 1.210    (+1 -0 lines)