From: stronk7 Date: Sat, 20 Sep 2003 17:08:45 +0000 (+0000) Subject: Added one check to avoid some notices in make_categories_list(). X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2832badf384ff505b14ed76f7f54a0481b27cdec;p=moodle.git Added one check to avoid some notices in make_categories_list(). Commented in Moodle's forum: http://moodle.org/mod/forum/discuss.php?d=2627 --- diff --git a/course/lib.php b/course/lib.php index 151c7d5990..ea300310cb 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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);