From 2832badf384ff505b14ed76f7f54a0481b27cdec Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sat, 20 Sep 2003 17:08:45 +0000 Subject: [PATCH] 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 --- course/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.5