]> git.mjollnir.org Git - moodle.git/commitdiff
one more category locking fix
authorskodak <skodak>
Fri, 13 Jul 2007 09:12:23 +0000 (09:12 +0000)
committerskodak <skodak>
Fri, 13 Jul 2007 09:12:23 +0000 (09:12 +0000)
lib/grade/grade_category.php

index 7f6d7f1cb69785de18c4f41d1fd7c5087129c76a..b192d294072673236a6935e093c5e9028a94e0da 100644 (file)
@@ -909,17 +909,22 @@ class grade_category extends grade_object {
      */
     function set_locked($lockedstate) {
         $this->load_grade_item();
-        $this->grade_item->set_locked($lockedstate);
+        $result = $this->grade_item->set_locked($lockedstate);
         if ($children = grade_item::fetch_all(array('categoryid'=>$this->id))) {
             foreach($children as $child) {
-                $child->set_locked($lockedstate);
+                if (!$child->set_locked($lockedstate)) {
+                    $result = false;
+                }
             }
         }
         if ($children = grade_category::fetch_all(array('parent'=>$this->id))) {
             foreach($children as $child) {
-                $child->set_locked($lockedstate);
+                if (!$child->set_locked($lockedstate)) {
+                    $result = false;
+                }
             }
         }
+        return $result;
     }
 
     /**