MDL-27233 move the restorer enrol/ra creation to the very beginning of the restore...
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 25 Nov 2011 00:07:27 +0000 (01:07 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 25 Nov 2011 00:07:27 +0000 (01:07 +0100)
commitede7105fd9b1376cf100c6832eface26438853c2
treec970e35f849b5354d2efc2a49fd86d4be96e3c87
parent2afaf485cf5341b8f17fd049a38f06d6c00691c3
MDL-27233 move the restorer enrol/ra creation to the very beginning of the restore process

Some early steps in restore are using capability checks to decide how to
restore some information. But at that stage, if the course contents have
been removed and the user had perms at course level only (usually teacher)
the process can fail because some content is not restoreable due to the
lack of permissions.

Moving the restorer step to the beginning really helps is those situations
and it does not hurt at all.

Also, fixed one notice detected when testing this.
backup/moodle2/restore_course_task.class.php
backup/moodle2/restore_root_task.class.php
backup/util/dbops/restore_dbops.class.php