Merge branch 'MDL-46978' of https://github.com/danielneis/moodle
This commit is contained in:
@@ -2249,14 +2249,11 @@ class grade_category extends grade_object {
|
||||
}
|
||||
|
||||
//if marking category visible make sure parent category is visible MDL-21367
|
||||
if( !$hidden ) {
|
||||
if ($this->is_hidden() != $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];
|
||||
//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);
|
||||
//}
|
||||
$category->set_hidden($hidden, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,14 +608,11 @@ class grade_item extends grade_object {
|
||||
}
|
||||
|
||||
//if marking item visible make sure category is visible MDL-21367
|
||||
if( !$hidden ) {
|
||||
if ($this->is_hidden() != $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];
|
||||
//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);
|
||||
//}
|
||||
$category->set_hidden($hidden, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user