mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-40035: Avoid rebuild_course_cache always for empty course
This commit is contained in:
parent
a327f25ef1
commit
00726467f6
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue