Skip to content

Commit

Permalink
MDL-35089 conditionals: detected one place missing sectioncache
Browse files Browse the repository at this point in the history
Thanks to MDL-34936 and unit tests this was discovered like 2 new
places calling to get_fast_modinfo() without the sectioncache
column contents. Potential performance problem, leading to
reseting and recalculation of caches all the time.
  • Loading branch information
stronk7 committed Aug 27, 2012
1 parent d71c486 commit 2b64e24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/conditionlib.php
Expand Up @@ -767,7 +767,7 @@ public function get_full_information($modinfo=null) {
$course = $COURSE;
} else {
$course = $DB->get_record('course', array('id' => $this->item->course),
'id, enablecompletion, modinfo', MUST_EXIST);
'id, enablecompletion, modinfo, sectioncache', MUST_EXIST);
}
foreach ($this->item->conditionscompletion as $cmid => $expectedcompletion) {
if (!$modinfo) {
Expand Down Expand Up @@ -929,7 +929,7 @@ public function is_available(&$information, $grabthelot=false, $userid=0, $modin
$course = $COURSE;
} else {
$course = $DB->get_record('course', array('id' => $this->item->course),
'id, enablecompletion, modinfo', MUST_EXIST);
'id, enablecompletion, modinfo, sectioncache', MUST_EXIST);
}

$completion = new completion_info($course);
Expand Down

0 comments on commit 2b64e24

Please sign in to comment.