Permalink
Browse files

MDL-34936 Warn if the sectioncache property is missing in a get_fast_…

…modinfo call
  • Loading branch information...
1 parent d71c486 commit fd0680ff4a3506354aabb89272cafe687590dcf7 @andrewnicols andrewnicols committed Aug 16, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/modinfolib.php
View
@@ -1204,6 +1204,10 @@ function get_fast_modinfo(&$course, $userid=0) {
debugging('Coding problem - missing course modinfo property in get_fast_modinfo() call');
}
+ if (!property_exists($course, 'sectioncache')) {
+ debugging('Coding problem - missing course sectioncache property in get_fast_modinfo() call');
+ }
+
unset($cache[$course->id]); // prevent potential reference problems when switching users
$cache[$course->id] = new course_modinfo($course, $userid);

0 comments on commit fd0680f

Please sign in to comment.