I was playing with setting up hierarchies for a number of entities and I noticed something that probably should count as a bug:
First, I set up a hierarchy with root ROOT, two children BRANCH 1 and BRANCH 2, where BRANCH 1 had children LEAVE A and LEAVE B and the second children TWIG 1 and TWIG 2. So, in all I had 7 entities.
Next, I snipped (the scissors thing) both BRANCH 1 and BRANCH 2 to make them roots of their own hierarchy.
So, at this point the entity ROOT was the root of a hierarchy with only one element. However, after the snipping, ROOT still showed that its hierarchy contained 7 elements. Moreover, both BRANCH 1 and BRANCH 2 were listed as part of a hierarchy containing only one element.
The only way I found to get the counts right was to snip the children to the two branches and then reattach them. This brought down the hierarchy count in ROOT to one and the count for the other two hierarchies up to 3.
At this point, I deleted ROOT and I was left with the two new branches. I was concerned that without getting the counter right, deleting ROOT would somehow delete all seven entities. However, redoing this experiment, but deleting ROOT before getting the counts right did not seem to affect the other six entities. Still, the number of entities in either new hierarchy always ends up being listed as 1 (see attachment). The trick I used to fix this count should still work , but if the hierarchies had been much bigger, this trick would not be feasible.
Just thought you might want to know. I did not check if the same thing happens for any of the other primary items. I am using the php8.1 development branch (schema revision 186).
Eisso