Fix visible items in category boxes
authorMarcel Werk <burntime@woltlab.com>
Mon, 19 Feb 2024 17:37:40 +0000 (18:37 +0100)
committerOlaf Braun <info@braun-development.de>
Thu, 7 Mar 2024 15:37:00 +0000 (16:37 +0100)
ref https://www.woltlab.com/community/thread/303963-men%C3%BC-filebase-sidebar-auflistung-der-kategorien/

wcfsetup/install/files/lib/data/category/CategoryNode.class.php

index 011cc5d61b3cbb2f89374fcf0919d3bdd99c5c1e..aa6eb22ff9a4fce00a09d0bb7619dded6f9fbe9c 100644 (file)
@@ -59,6 +59,13 @@ class CategoryNode extends DatabaseObjectDecorator implements IObjectTreeNode
                 // is a direct child element of the active category
                 return true;
             }
+
+            foreach ($activeCategory->getParentCategories() as $parentCategory) {
+                if ($this->getParentCategory()->categoryID == $parentCategory->categoryID) {
+                    // This is a child element of a parent category of the active category.
+                    return true;
+                }
+            }
         }
 
         return false;