From 4a3dfd9af1db962d82b292300ea6defab8f31788 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 4 Oct 2007 09:00:29 +0000 Subject: [PATCH] MDL-11582 switch category item only if it is really there - forgot to add courseitem into condition --- grade/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grade/lib.php b/grade/lib.php index 9a5ad49dc8..a43c462ab9 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -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]); -- 2.39.5