mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
grader report MDL-21367 when an item is unhidden its category should unhide to
This commit is contained in:
parent
b9cc756ef3
commit
d90aa63419
@ -1531,6 +1531,18 @@ class grade_category extends grade_object {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if marking category visible make sure parent category is visible MDL-21367
|
||||
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];
|
||||
//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);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -570,6 +570,18 @@ class grade_item extends grade_object {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if marking item visible make sure category is visible MDL-21367
|
||||
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];
|
||||
//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);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user