Always display the second level categories for articles
authorMarcel Werk <burntime@woltlab.com>
Mon, 3 Jun 2019 10:46:02 +0000 (12:46 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 3 Jun 2019 10:46:02 +0000 (12:46 +0200)
Closes #2886

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

index 4cadf7c0a73ff5e10a5ee09a85b13494f16f5a93..5d9c46a376440c3cebfb5a8e36be908deb38a2f7 100644 (file)
@@ -169,8 +169,8 @@ class CategoryNode extends DatabaseObjectDecorator implements \RecursiveIterator
         * @since       5.2
         */
        public function isVisibleInNestedList(AbstractDecoratedCategory $activeCategory = null) {
-               if (!$this->getParentCategory()) {
-                       // level 1 is always visible
+               if (!$this->getParentCategory() || ($this->getParentCategory() && !$this->getParentCategory()->getParentCategory())) {
+                       // level 1 & 2 are always visible
                        return true;
                }