Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-34476 - Blocks - Fixing context issue

  • Loading branch information...
commit f0f3338000d29837203863a0d965671de7481fe1 1 parent 678e90a
@jsnfwlr jsnfwlr authored samhemelryk committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 blocks/completionstatus/block_completionstatus.php
View
4 blocks/completionstatus/block_completionstatus.php
@@ -51,8 +51,10 @@ public function get_content() {
// Create empty content
$this->content = new stdClass();
+ $context = get_context_instance(CONTEXT_COURSE, $course->id);
+
// Can edit settings?
- $can_edit = has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id));
+ $can_edit = has_capability('moodle/course:update', $context);
// Get course completion data
$info = new completion_info($course);
Please sign in to comment.
Something went wrong with that request. Please try again.