]> git.mjollnir.org Git - moodle.git/commitdiff
Added one check to avoid some notices in make_categories_list().
authorstronk7 <stronk7>
Sat, 20 Sep 2003 17:08:45 +0000 (17:08 +0000)
committerstronk7 <stronk7>
Sat, 20 Sep 2003 17:08:45 +0000 (17:08 +0000)
Commented in Moodle's forum: http://moodle.org/mod/forum/discuss.php?d=2627

course/lib.php

index 151c7d59901cbe8cc7f1a51950495918ba611d05..ea300310cb48d82f912c80b2bc615c8eca3ea61d 100644 (file)
@@ -895,7 +895,9 @@ function make_categories_list(&$list, &$parents, $category=NULL, $path="") {
     if ($categories = get_categories("$category->id")) {   // Print all the children recursively
         foreach ($categories as $cat) {
             if (!empty($category->id)) {
-                $parents[$cat->id]   = $parents[$category->id];
+                if (!empty($parents[$category->id])) {
+                    $parents[$cat->id]   = $parents[$category->id];
+                }
                 $parents[$cat->id][] = $category->id;
             }
             make_categories_list($list, $parents, $cat, $path);