Issue Details (XML | Word | Printable)

Key: MDL-16614
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Tim Hunt
Reporter: Przemyslaw Stencel
Votes: 0
Watchers: 3
Operations

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

createdby and modifiedby assigned to wrong people when course restored to another site

Created: 23/Sep/08 01:06 AM   Updated: 20/Jan/09 12:16 PM
Return to search
Component/s: Backup, Questions
Affects Version/s: 1.9.2
Fix Version/s: 1.9.4

File Attachments: 1. Text File backupsamesite.patch.txt (15 kB)
2. Text File backupsamesite.patch.txt (15 kB)
3. Text File questioncreatormodifierrestore.patch.txt (2 kB)

Issue Links:
Duplicate
 

Database: Any
Participants: Eloy Lafuente (stronk7), Martin Dougiamas, Przemyslaw Stencel and Tim Hunt
Security Level: None
Resolved date: 20/Jan/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
If I make a backup of a course and then restore that backup into another moodle site, the questions get assigned to a wrong person. Backup file (moodle.xml) includes the following info for each question:
            <CREATEDBY>xyz</CREATEDBY>
            <MODIFIEDBY>xyz</MODIFIEDBY>
where "xyz" is the id number of the user who created or modified the question. The problem is, if you restore the backup to another moodle site, user xyz is a totally different person (!)

I suggest that if a backup is restored to another site (it can easily be detected during the restore process by comparing <ORIGINAL_WWWROOT> from the moodle xml file to the current www root), both values (CREATEDBY and MODIFIEDBY) should be set to 0 (unknown) or 1 (admin user)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
tjhunt committed 10 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 20/Jan/09 12:16 PM
backup/restore: MDL-16614 more reliable test for when we are restoring a backup that was made of the same site that we are restoring to.

* Use this to fix a question restore bug.
* Replace older code that does something similar with the new test.
* Refactor initialisation of $CFG->siteidentifier into a function. There were about 4 copies of this code ;-)
MODIFY admin/index.php   Rev. 1.286.2.28    (+3 -5 lines)
MODIFY backup/lib.php   Rev. 1.89.2.8    (+20 -1 lines)
MODIFY backup/restore_execute.html   Rev. 1.62.4.3    (+5 -1 lines)
MODIFY backup/backuplib.php   Rev. 1.179.2.37    (+3 -1 lines)
MODIFY lib/moodlelib.php   Rev. 1.960.2.115    (+15 -7 lines)
MODIFY lang/en_utf8/moodle.php   Rev. 1.141.2.54    (+2 -1 lines)
MODIFY admin/register.php   Rev. 1.25.2.3    (+2 -8 lines)
MODIFY backup/restorelib.php   Rev. 1.283.2.61    (+18 -6 lines)
MODIFY backup/restore_check.html   Rev. 1.48.2.11    (+2 -2 lines)
MODIFY question/restorelib.php   Rev. 1.30.2.6    (+23 -3 lines)
tjhunt committed 10 files to 'Moodle CVS' - 20/Jan/09 12:16 PM
backup/restore: MDL-16614 more reliable test for when we are restoring a backup that was made of the same site that we are restoring to.

* Use this to fix a question restore bug.
* Replace older code that does something similar with the new test.
* Refactor initialisation of $CFG->siteidentifier into a function. There were about 4 copies of this code ;-)
MODIFY backup/restore_check.html   Rev. 1.65    (+2 -2 lines)
MODIFY question/restorelib.php   Rev. 1.41    (+23 -3 lines)
MODIFY admin/index.php   Rev. 1.359    (+1 -3 lines)
MODIFY backup/restorelib.php   Rev. 1.365    (+18 -6 lines)
MODIFY backup/backuplib.php   Rev. 1.226    (+3 -1 lines)
MODIFY backup/lib.php   Rev. 1.111    (+20 -1 lines)
MODIFY lang/en_utf8/moodle.php   Rev. 1.224    (+2 -1 lines)
MODIFY backup/restore_execute.html   Rev. 1.68    (+5 -1 lines)
MODIFY lib/moodlelib.php   Rev. 1.1159    (+15 -7 lines)
MODIFY admin/register.php   Rev. 1.32    (+3 -7 lines)
Mitsuhiro Yoshida committed 3 files to 'Lang CVS' - 23/Jan/09 01:33 AM
MDL-16614 Translated a new string for restoring backups.
MDL-17871 Translated new strings for question bank.
Brushed up translated strings fro LDAP enrollment.
MODIFY ja_utf8/moodle.php   Rev. 1.344    (+4 -1 lines)
MODIFY ja_utf8/enrol_ldap.php   Rev. 1.15    (+6 -10 lines)
MODIFY ja_utf8/README   Rev. 1.923    (+1 -1 lines)
martignoni committed 1 file to 'Lang CVS' - 24/Jan/09 04:46 AM
MDL-16614 String added
MODIFY fr_utf8/moodle.php   Rev. 1.276    (+7 -6 lines)