If a user deletes a grouping under a course that is still used by an activity, the application allows it.
It then throws the warning:
Notice: Undefined index: 57585 in lib/modinfolib.php on line 1801
Notice: Trying to get property of non-object in lib/modinfolib.php
on line 1801
It also throws the warning (in the section):
Notice: Undefined index: 65375 in course/renderer.php on line 725
The lines in modinfolib.php:
$this->_availableinfo = html_writer::tag('span', '(' . format_string(
$groupings[$this->_groupingid]->name, true, array('context' => $context)) .
')', array('class' => 'groupinglabel'));
Should check if the $this->_groupingid exists in the $groupings array.
Same check needed for course/renderer.php
But, this leaves orphaned groupings in mdl_course_modules:
select * from mdl_course_modules where course = xxx and groupingid > 0;
A check needs to also exist when deleting the groupings that they are not used in an activity.
- duplicates
-
MDL-40145 Notices are generated on course page after deleting a grouping
-
- Closed
-