Skip to content

Commit

Permalink
one more category locking fix
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 13, 2007
1 parent 7a7a53d commit b121b54
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/grade/grade_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,17 +909,22 @@ function is_locked() {
*/
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;
}

/**
Expand Down

0 comments on commit b121b54

Please sign in to comment.