diff --git a/lib/coursecatlib.php b/lib/coursecatlib.php index 70500888ebf..0c71d4272a1 100644 --- a/lib/coursecatlib.php +++ b/lib/coursecatlib.php @@ -581,6 +581,9 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate { } else { // parent not found. This is data consistency error but next fix_course_sortorder() should fix it $all[0][] = $record->id; + if (!$record->visible) { + $all['0i'][] = $record->id; + } } $count++; }