MDL-11582 switch category item only if it is really there - forgot to add courseitem into condition

This commit is contained in:
skodak 2007-10-04 09:00:29 +00:00
parent 6f0078e5a0
commit 4a3dfd9af1

View File

@ -942,7 +942,7 @@ class grade_tree {
return;
}
$first_item = reset($element['children']);
if ($first_item['type'] == 'categoryitem') {
if ($first_item['type'] == 'categoryitem' or $first_item['type'] == 'courseitem') {
// the category item might have been already removed
$order = key($element['children']);
unset($element['children'][$order]);