MDL-30518 get_context_instance takes one parameter at the SYSTEM level
authorCharles Fulton <mackensen@gmail.com>
Wed, 30 Nov 2011 13:47:50 +0000 (05:47 -0800)
committerCharles Fulton <mackensen@gmail.com>
Wed, 30 Nov 2011 13:47:50 +0000 (05:47 -0800)
tag/coursetags_edit.php
user/profile/field/checkbox/field.class.php

index be710fe..18d40a4 100644 (file)
@@ -41,7 +41,7 @@ if ($courseid != SITEID) {
 }
 
 // Permissions
-$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
+$sitecontext = get_context_instance(CONTEXT_SYSTEM);
 require_login($course->id);
 $canedit = has_capability('moodle/tag:create', $sitecontext);
 
index 75c955d..29aaf3d 100644 (file)
@@ -29,7 +29,7 @@ class profile_field_checkbox extends profile_field_base {
             $checkbox->setChecked(true);
         }
         $mform->setType($this->inputname, PARAM_BOOL);
-        if ($this->is_required() and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
+        if ($this->is_required() and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM))) {
             $mform->addRule($this->inputname, get_string('required'), 'nonzero', null, 'client');
         }
     }