MDL-26951 fix removing of archetype from role
authorPetr Skoda <commits@skodak.org>
Sun, 27 Mar 2011 14:04:33 +0000 (16:04 +0200)
committerPetr Skoda <commits@skodak.org>
Sun, 27 Mar 2011 14:04:33 +0000 (16:04 +0200)
admin/roles/lib.php

index e211340..fc6e7d8 100644 (file)
@@ -628,7 +628,7 @@ class define_role_table_advanced extends capability_table_with_risks {
 
         // Legacy type.
         $archetype = optional_param('archetype', null, PARAM_RAW);
-        if ($archetype) {
+        if (isset($archetype)) {
             $archetypes = get_role_archetypes();
             if (isset($archetypes[$archetype])){
                 $this->role->archetype = $archetype;
@@ -716,7 +716,6 @@ class define_role_table_advanced extends capability_table_with_risks {
     }
 
     protected function get_archetype_field($id) {
-        global $OUTPUT;
         $options = array();
         $options[''] = get_string('none');
         foreach(get_role_archetypes() as $type) {