Issue Details (XML | Word | Printable)

Key: MDL-12922
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Eloy Lafuente (stronk7)
Reporter: Kenneth Newquist
Votes: 19
Watchers: 10
Operations

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

Course restores for non-admin users appear ~7 years early

Created: 11/Jan/08 06:00 AM   Updated: 06/Oct/09 10:09 AM
Return to search
Component/s: Backup
Affects Version/s: 1.8.3, 1.9.3
Fix Version/s: 1.8.8, 1.9.4

File Attachments: 1. Text File 192_restore_form_patch.txt (2 kB)
2. File backup_restore_fix.diff (0.8 kB)
3. File backup_restore_fix_1.9.diff (2 kB)

Environment: 1.8.3+ (2007021534)
Issue Links:
Relates
 

Database: MySQL
Participants: Barron Koralesky, David Kelly, Eloy Lafuente (stronk7), Kenneth Newquist, Martin Dougiamas, Marty Gilbert, Mary Parke, matt greenwolfe, Rahim Virani, Tim Hunt and Yolanda Ordoñez Rufat
Security Level: None
QA Assignee: Tim Hunt
Resolved date: 03/Jan/09
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
There is a problem in the restore component of backup that causes the dates on forum posts to be wildly off (7+ years) when a course with forums is restored by a teacher. If a course is restored by an admin, the forum post dates come in correctly.

What's happening is that /backup/restore_form.html has logic that checks to see if a course has a start date, and if it does, it gives the user the ability to modify that start date.

However the problem is that this start-date-checking logic is tied to the "course creator" capability -- if you don't have the coursecreator capability (and teachers don't) then it doesn't do the check, and assigns the start date to 0, which triggers some date offset calculations, which results in the wonky dates.

I've created a patch that fixes the problem by moving this logic out of the "coursecreator" portion of "restore_form.html". As a result, teachers will now see the "course startdate" field as well, and everything works as it should. The patch is attached to this bug report.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
matt greenwolfe made changes - 01/May/08 09:49 AM
Field Original Value New Value
Attachment backup_restore_fix_1.9.diff [ 13817 ]
Kenneth Newquist made changes - 17/Jul/08 10:58 PM
Attachment 192_restore_form_patch.txt [ 14572 ]
Martin Dougiamas made changes - 30/Dec/08 08:50 AM
Assignee Martin Dougiamas [ dougiamas ] Eloy Lafuente (stronk7) [ stronk7 ]
Fix Version/s 1.8.8 [ 10314 ]
Fix Version/s 1.9.4 [ 10300 ]
Eloy Lafuente (stronk7) made changes - 03/Jan/09 03:03 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Eloy Lafuente (stronk7) made changes - 03/Jan/09 03:03 AM
Affects Version/s 1.9.3 [ 10290 ]
Tim Hunt made changes - 06/Jan/09 11:22 AM
Status Resolved [ 5 ] Closed [ 6 ]
Tim Hunt made changes - 06/Jan/09 11:23 AM
QA Assignee timhunt
Eloy Lafuente (stronk7) made changes - 16/Jan/09 04:44 AM
Link This issue is blocked by MDL-17917 [ MDL-17917 ]
Eloy Lafuente (stronk7) made changes - 16/Jan/09 04:44 AM
Link This issue is blocked by MDL-17917 [ MDL-17917 ]
Eloy Lafuente (stronk7) made changes - 16/Jan/09 04:45 AM
Link This issue has been marked as being related by MDL-17917 [ MDL-17917 ]