Permalink
Browse files

MDL-35089 conditionals: detected one place missing sectioncache

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...
1 parent d71c486 commit 2b64e24ebe637b49188103671b5f043918eb1057 @stronk7 stronk7 committed Aug 27, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/conditionlib.php
@@ -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) {
@@ -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);

0 comments on commit 2b64e24

Please sign in to comment.