Course Creators cannot restore a course in Moodle 1.6.1 and 1.6.2+ up to 2006-09-27.
The restore process fails, because the course creator cannot be assigned as teacher to the newly created/restored course.
Reason:
Line 5347 and folllowing in restorelib.php:
if (!isadmin()) {
if (!$checktea = get_records('user_teachers','course', $restore->course_id))
}
The Variable $USER is not declared as global in the function restore_execute, so add_teacher is called with an empty user-id.
Suggested Solution: add global $USER to funtion, for example:
if (!isadmin()) {
if (!$checktea = get_records('user_teachers','course', $restore->course_id))
}