]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11582 switch category item only if it is really there - forgot to add courseitem...
authorskodak <skodak>
Thu, 4 Oct 2007 09:00:29 +0000 (09:00 +0000)
committerskodak <skodak>
Thu, 4 Oct 2007 09:00:29 +0000 (09:00 +0000)
grade/lib.php

index 9a5ad49dc8e7f088506cd4733a68b29f88006663..a43c462ab99f1740b5c95ee8564899594a6b86c2 100644 (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]);