-
Bug
-
Resolution: Fixed
-
Blocker
-
4.5
-
MOODLE_405_STABLE
-
MOODLE_405_STABLE
-
MDL-82688-main -
- Navigate to Site admin -> Plugins -> Filters
- Enable the Database auto-linking filter
- Navigate to Site home and select a filter
- Confirm no errors
MDL-82427 caused a regression in some Moodle sites using filters:
dobedobedoh found and fixed it:
- if (!$coursectx) { |
- // We could be in a course category so no entries for courseid == 0 will be found. |
- $courseid = 0; |
- } else { |
- $courseid = $coursectx->instanceid;
|
- }
|
+ // We could be in a course category so no entries for courseid == 0 will be found. |
+ $courseid = $coursectx?->instanceid ?: 0; |
|
So the fix is
// Try to get current course. |
// We could be in a course category so no entries for courseid == 0 will be found. |
$courseid = 0; |
if ($coursectx = $this->context->get_course_context(false)) { |
$courseid = $coursectx->instanceid;
|
}
|
I've been able to confirm that this patch fixes the error in my local site
- is a regression caused by
-
MDL-82427 Split filterlib.php
-
- Closed
-