I've searched the bug reports, but I couldn't find one for this bug. However if it's been already reported please feel free to close this, as it's been a while since I last worked with category and I might have missed it.
I'm not sure what was the last version this worked in, as I don't have anymore access to that server, but I do remember that if you followed the Creating a basic hybrid structure tutorial, you once could have a TOC of all your site hierarchy if you set the depth of TOC on the Articles container (in the tutorial) to any negative value.
As of at least the most recent version of category, this is not true anymore. Steps to reproduce:
1) follow the tutorial and recreate the structure exactly
2) modify the root container, the one called 'Articles', and set the depth of its TOC to -1 or another negative value
3) save and you'll notice no TOC is displayed at all in the Articles container.
The only way I've managed to have a TOC display something in the articles container is if I create a new category, direct children of the Articles container. But if you set the depth to negative, you should have the TOC display not only direct children, but also children of your children (in the tutorial case, you should have listed also the categories that are children of the container that is direct child of the Articles container). Instead, only categories that are direct children are listed, as if the depth attribute were ignored entirely.
Comments
Comment #1
Permanently Undecided commentedTry the tutorial on the demo site and you'll see it works fine there, instead. Since the demo site is running an older version of the module, it seems to me it's a bug introduced somewhen along the line.
Comment #2
Permanently Undecided commentedI've finally found out why this happens.
While viewing a container, let's call it 'container A', if you click the 'add child container' option you expect the child container to automatically have the parent set to 'container A', as it happens when you click 'add child category'. This instead doesn't happen anymore: when you click the 'add child container' option, the Parent option isn't automatically set, and defaults to 'Root' instead.
If you don't set it manually to the container A you wanted, you get 'Root' as the parent, and thus all the hierarchy becomes broken.
This is misleading: the behavior should be the same as in the 'add child category' option, where the parent is already set to the container where you originally clicked the link.
I've renamed the issue accordingly and set it to priority minor.
Comment #3
Permanently Undecided commentedAnd I forgot to set the component back to category module.
Comment #4
Permanently Undecided commentedApparently the problem is more serious than I thought. The reason the TOC is broken is because category_get_parents does not return parents for containers, which obviously breaks the site structure. Since the 'add child container link doesn't automatically set the correct parent anymore' issue is still present, I think I'll close this issue as it is to avoid misunderstandings and open two separate issues.
Comment #5
Permanently Undecided commentedHere are the links to the separate issues:
'add child container' link doesn't automatically set the correct parent anymore
category_get_parents doesn't return parents for containers
Comment #6
Permanently Undecided commentedThis has been fixed in the 5 Jan official releases, both of 4.7 and 5.0.