From b73d8a35c2eaa4d15be7d595d4d97513a25dff86 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 5 Sep 2013 11:30:45 +1000 Subject: [PATCH] MDL-41594 Bug fix for orphaned invisible categories thanks to L.Sanocki --- lib/coursecatlib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/coursecatlib.php b/lib/coursecatlib.php index 9cd0f6cb833..7db820fc647 100644 --- a/lib/coursecatlib.php +++ b/lib/coursecatlib.php @@ -596,6 +596,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++; }