Revert "MDL-46978 gradebook: Edit grade item changes visibility of category"

This reverts commit f9f37ec8f4.
This commit is contained in:
Sam Hemelryk
2014-10-08 10:37:42 +13:00
parent 5f0def5568
commit 01fd426bfa
2 changed files with 10 additions and 4 deletions
+5 -2
View File
@@ -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);
//}
}
}
}
+5 -2
View File
@@ -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);
//}
}
}
}