Revert "MDL-46978 gradebook: Edit grade item changes visibility of category"
This reverts commit f9f37ec8f4.
This commit is contained in:
@@ -1691,11 +1691,14 @@ class grade_category extends grade_object {
|
||||
}
|
||||
|
||||
//if marking category visible make sure parent category is visible MDL-21367
|
||||
if ($this->is_hidden() != $hidden) {
|
||||
if( !$hidden ) {
|
||||
$category_array = grade_category::fetch_all(array('id'=>$this->parent));
|
||||
if ($category_array && array_key_exists($this->parent, $category_array)) {
|
||||
$category = $category_array[$this->parent];
|
||||
$category->set_hidden($hidden, false);
|
||||
//call set_hidden on the category regardless of whether it is hidden as its parent might be hidden
|
||||
//if($category->is_hidden()) {
|
||||
$category->set_hidden($hidden, false);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -594,11 +594,14 @@ class grade_item extends grade_object {
|
||||
}
|
||||
|
||||
//if marking item visible make sure category is visible MDL-21367
|
||||
if ($this->is_hidden() != $hidden) {
|
||||
if( !$hidden ) {
|
||||
$category_array = grade_category::fetch_all(array('id'=>$this->categoryid));
|
||||
if ($category_array && array_key_exists($this->categoryid, $category_array)) {
|
||||
$category = $category_array[$this->categoryid];
|
||||
$category->set_hidden($hidden, false);
|
||||
//call set_hidden on the category regardless of whether it is hidden as its parent might be hidden
|
||||
//if($category->is_hidden()) {
|
||||
$category->set_hidden($hidden, false);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user