commit 68552d144dcece3dc5e8d6ed7fab28bdb8a81c4b Author: Troy Williams Date: Wed Oct 12 10:58:53 2011 +1300 MDL-29083 Course report outline fails when blogs are deactivated diff --git a/course/report/outline/index.php b/course/report/outline/index.php index ad4ef64..8c64348 100644 --- a/course/report/outline/index.php +++ b/course/report/outline/index.php @@ -124,13 +124,14 @@ $reportrow->cells[] = $numviewscell; - if ($CFG->useblogassociations) { + if ($CFG->useblogassociations) { // MDL-29083 Course report "outline" fails when blogs are deactivated + require_once($CFG->dirroot.'/blog/lib.php'); $blogcell = new html_table_cell(); $blogcell->attributes['class'] = 'blog'; - if ($blogcount = blog_get_associated_count($course->id, $cm->id)) { - $blogcell->text = html_writer::link('/blog/index.php?modid='.$cm->id, $blogcount); - } else { - $blogcell->text = '-'; + if ($blogcount = blog_get_associated_count($course->id, $cm->id)) { + $blogcell->text = html_writer::link('/blog/index.php?modid='.$cm->id, $blogcount); + } else { + $blogcell->text = '-'; } $reportrow->cells[] = $blogcell; }