Permalink
Browse files

Merge branch 'MDL-27757-HEAD' of git://github.com/srynot4sale/moodle

  • Loading branch information...
2 parents 89b2cdb + 7075e37 commit 355871acd54e9360f825b8710b5876fc1c4095e7 Sam Hemelryk committed Jun 13, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/completionlib.php
View
@@ -185,13 +185,18 @@ public static function is_enabled_for_site() {
* for a course-module.
*/
public function is_enabled($cm=null) {
- global $CFG;
+ global $CFG, $DB;
// First check global completion
if (!isset($CFG->enablecompletion) || $CFG->enablecompletion == COMPLETION_DISABLED) {
return COMPLETION_DISABLED;
}
+ // Load data if we do not have enough
+ if (!isset($this->course->enablecompletion)) {
+ $this->course->enablecompletion = $DB->get_field('course', 'enablecompletion', array('id' => $this->course->id));
+ }
+
// Check course completion
if ($this->course->enablecompletion == COMPLETION_DISABLED) {
return COMPLETION_DISABLED;

0 comments on commit 355871a

Please sign in to comment.