Create course 'a' and 'b' and enrol as student in both
Configure course completion on 'b'.
Add an activity module in 'a' with restriction targeting 'b'
On edit page the following warning appears
Notice: Undefined property: stdClass::$completiongradeitemnumber in /var/www/html/availability/condition/othercompleted/classes/frontend.php on line 62
Then save and followings warnings should appear :
Notice: Undefined property: stdClass::$completiongradeitemnumber in /var/www/html/availability/condition/othercompleted/classes/frontend.php on line 62 Notice: Trying to get property 'id' of non-object in /var/www/html/availability/condition/othercompleted/classes/condition.php on line 91
Go to course 'a' (or 'b') page
Notice: Trying to get property 'id' of non-object in /var/www/html/availability/condition/othercompleted/classes/condition.php on line 91
Complete 'b' course.
Repeat 4. The following error should appears :
Invalid course_modinfo property accessed: datcm
line 141 of /lib/modinfolib.php: call to debugging()
line 205 of /availability/condition/othercompleted/classes/condition.php: call to course_modinfo->__get()
line 772 of /availability/classes/info.php: call to availability_othercompleted\condition::completion_value_used()
line 492 of /course/renderer.php: call to core_availability\info::completion_value_used()
line 898 of /course/renderer.php: call to core_course_renderer->course_section_cm_completion()
line 800 of /course/renderer.php: call to core_course_renderer->course_section_cm()
line 993 of /course/renderer.php: call to core_course_renderer->course_section_cm_list_item()
line 887 of /course/format/renderer.php: call to core_course_renderer->course_section_cm_list()
line 57 of /course/format/topics/format.php: call to format_section_renderer_base->print_multiple_section_page()
line 290 of /course/view.php: call to require()
Warning: Invalid argument supplied for foreach() in /var/www/html/availability/condition/othercompleted/classes/condition.php on line 205
Hint for condition.php#L91 issue: To test `course_completions` entry existence you should use `$DB->record_exists()` instead of `$DB->get_record()` ;)
Tested on Moodle 3.7 Process
Notice: Undefined property: stdClass::$completiongradeitemnumber in /var/www/html/availability/condition/othercompleted/classes/frontend.php on line 62
Then save and followings warnings should appear :
Notice: Undefined property: stdClass::$completiongradeitemnumber in /var/www/html/availability/condition/othercompleted/classes/frontend.php on line 62 Notice: Trying to get property 'id' of non-object in /var/www/html/availability/condition/othercompleted/classes/condition.php on line 91
Notice: Trying to get property 'id' of non-object in /var/www/html/availability/condition/othercompleted/classes/condition.php on line 91
Repeat 4. The following error should appears :
Warning: Invalid argument supplied for foreach() in /var/www/html/availability/condition/othercompleted/classes/condition.php on line 205