-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.11.6, 4.1.14, 4.3.8, 4.4.4, 4.5
-
None
After overwriting an existing course with content with a backup file with different content, and selecting "Delete the contents of this course and then restore", the errors tab of the Brickfield accessibility report throws errors:
Notice: Undefined offset: 494128 in /var/www/html/admin/tool/brickfield/classes/local/tool/tool.php on line 300
Call Stack
- Time Memory Function Location
1 0.0001 365048 {main}( ) .../index.php:0
2 0.3149 7066584 tool_brickfield\local\tool\errors->get_output( ) .../index.php:146
3 0.3155 7068784 tool_brickfield\output\errors\renderer->display( ) .../tool.php:210
4 0.3161 7074336 tool_brickfield\local\tool\tool::get_instance_name( ) .../renderer.php:76
( ! ) Notice: Trying to get property 'name' of non-object in /var/www/html/admin/tool/brickfield/classes/local/tool/tool.php on line 301
Call Stack
- Time Memory Function Location
1 0.0001 365048 {main}( ) .../index.php:0
2 0.3149 7066584 tool_brickfield\local\tool\errors->get_output( ) .../index.php:146
3 0.3155 7068784 tool_brickfield\output\errors\renderer->display( ) .../tool.php:210
4 0.3161 7074336 tool_brickfield\local\tool\tool::get_instance_name( ) .../renderer.php:76
It appears the error comes from the module no longer being in the course_modules table (since it was deleted during the destructive restore).
I believe the course_restore event handler puts notations in the process table so when the cron task tool_brickfield\task\bulk_process_courses is run, it picks up these changes are modifies the areas table to remove deleted modules and add new or updated modules to be checked. However on that cron task, we are seeing the following error:
Notice: Undefined offset: 0 in /var/www/html/admin/tool/brickfield/classes/manager.php on line 386
Call Stack:
0.0008 346904 1. {main}() /var/www/html/admin/cli/scheduled_task.php:0
0.4780 2909424 2. cron_run_inner_scheduled_task() /var/www/html/admin/cli/scheduled_task.php:167
0.4989 3629936 3. tool_brickfield\task\bulk_process_courses->execute() /var/www/html/lib/cronlib.php:253
0.5002 3630032 4. tool_brickfield\accessibility::bulk_process_courses_cron() /var/www/html/admin/tool/brickfield/classes/task/bulk_process_courses.php:46
0.5026 3631824 5. tool_brickfield\accessibility::bulk_processing() /var/www/html/admin/tool/brickfield/classes/accessibility.php:158
0.5026 3631824 6. tool_brickfield\manager::check_course_updates() /var/www/html/admin/tool/brickfield/classes/accessibility.php:173
0.5039 3642024 7. tool_brickfield\manager::find_new_or_updated_areas_per_course() /var/www/html/admin/tool/brickfield/classes/manager.php:513
1.2584 4011320 8. tool_brickfield\manager::check_scheduled_areas() /var/www/html/admin/tool/brickfield/classes/manager.php:347
I have tried to debug further but cannot determine why the areas table is not properly being updated after the destructive course restore. Any help would be most appreciated!