Details
Description
Somehow this block managed to get on the admin pagetype for a site I'm helping with and it caused rebuild_course_cache to get rebuilt for the entire site... 24,000 queries!
this teeny patch fixes it:
diff --git a/blocks/activity_modules/block_activity_modules.php b/blocks/activity_modules/block_activity_modules.php
index 14e9239..9f4e5f7 100644
— a/blocks/activity_modules/block_activity_modules.php
+++ b/blocks/activity_modules/block_activity_modules.php
@@ -24,6 +24,9 @@ class block_activity_modules extends block_list {
$course = get_record('course', 'id', $this->instance->pageid);
}
+ if (empty($course)) {
+ return '';
+ }
require_once($CFG->dirroot.'/course/lib.php');
$modinfo = get_fast_modinfo($course);
which I will commit to head & stable if nobody stops me ![]()
+1 for commit