-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.6, 4.2.3, 4.4.1
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_404_STABLE
Context
Have recycle bin activated. Have a course in the recycle bin of its category, with logs incorporated into the backup. Moodle 4.1.6+ weekly.
Problem
When restoring the course into a new course, with development debugging activated, one can see lots of warnings. See attached file.
In summary, they are the following ones, restoring a single course:
$ grep -i "In order" warnings_while_restoring_a_course.log | sort | uniq -c
|
1 In order to restore course logs accurately the event "core\event\course_section_deleted" must define the function get_objectid_mapping().
|
1 In order to restore course logs accurately the event "core\event\course_section_deleted" must define the function get_other_mapping().
|
18 In order to restore course logs accurately the event "core\event\grade_item_created" must define the function get_objectid_mapping().
|
18 In order to restore course logs accurately the event "core\event\grade_item_created" must define the function get_other_mapping().
|
138 In order to restore course logs accurately the event "core\event\grade_item_updated" must define the function get_objectid_mapping().
|
138 In order to restore course logs accurately the event "core\event\grade_item_updated" must define the function get_other_mapping().
|
2 In order to restore course logs accurately the event "mod_folder\event\all_files_downloaded" must define the function get_objectid_mapping().
|
3 In order to restore course logs accurately the event "tool_recyclebin\event\course_bin_item_created" must define the function get_objectid_mapping().
|
referring to these events:
$ grep -i "In order" warnings_while_restoring_a_course.log | sort | uniq | grep -oP "\".*\"" | uniq
|
"core\event\course_section_deleted"
|
"core\event\grade_item_created"
|
"core\event\grade_item_updated"
|
"mod_folder\event\all_files_downloaded"
|
"tool_recyclebin\event\course_bin_item_created"
|
referring in some cases to one method and in other cases to two methods. They are always the same two:
$ grep -i "In order" warnings_while_restoring_a_course.log | sort | uniq | grep -oP "get\_.*" | sort | uniq
|
get_objectid_mapping().
|
get_other_mapping().
|
How to reproduce
It was a real course, but for the above records, I assume all these actions should be performed in the course, before putting it into the recycle bin:
Then as admin:
- Be sure default settings for course backups include logs.
- Be sure category recycle bin and course recycle bin are activated.
- Debug has to be on DEBUG_DEVELOPER level.
- As admin, create a course
- Have enrolled at least one student
- Have enrolled at least one teacher
- As teacher, have at least one gradable activity, like a mod_assign
- As teacher, delete at least one course section (to trigger "core\event\course_section_deleted" event)
- As teacher, grade for the first time a student (to trigger "core\event\grade_item_created" event)
- As teacher, regrade a second time the same student (to trigger "core\event\grade_item_updated" event)
- As teacher, create a folder with some files on it (mod_folder).
- As student, dowload all files (to trigger "mod_folder\event\all_files_downloaded" event)
- As teacher, create an activity on the course and delete it (to trigger "tool_recyclebin\event\course_bin_item_created" event)
As admin:
- Delete the above course. This will put the course's backup into the category's recycle bin.
- Go to the category's recycle bin.
- Click to restore the course.
- You should see a similar stack trace, one stack trace for each different event.
Expected behaviour
With development debugging activated, no warning should be seen.