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
This commit is contained in:
stronk7
2003-09-20 17:08:45 +00:00
parent a9a070e0fd
commit 2832badf38
+3 -1
View 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);