MDL-40035: Avoid rebuild_course_cache always for empty course
authorTony Levi <tony.levi@netspot.com.au>
Thu, 6 Jun 2013 04:41:19 +0000 (14:11 +0930)
committerMarina Glancy <marina@moodle.com>
Tue, 9 Jul 2013 03:53:27 +0000 (13:53 +1000)
lib/modinfolib.php

index f099328..fc93e14 100644 (file)
@@ -275,7 +275,7 @@ class course_modinfo extends stdClass {
 
         // Load sectioncache field into memory as PHP object and check it's valid
         $sectioncache = unserialize($course->sectioncache);
-        if (!is_array($sectioncache) || empty($sectioncache)) {
+        if (!is_array($sectioncache)) {
             // hmm, something is wrong - let's fix it
             rebuild_course_cache($course->id);
             $course->sectioncache = $DB->get_field('course', 'sectioncache', array('id'=>$course->id));