Closed stojg closed 10 years ago
Perhaps this is an issue with the isOrphaned check? CMS users should still be able to view orphaned pages though, so maybe it's just a permission tweak.
No, the parent page is still there, but everything is for sure everything is connected in versioned / hierarchy in someway.. so who knows.
It might be related to Hierarchy::numChildren() that returns 0 number of childrens for a page with deleted children... might..
Yeah, I found the problem, will make a PR for this. As a side note, we need more automatic test that actually uses the hierarchy.
This seems to be an issue when the framework is using the default numChildren() when the code should use numHistoricalChildren()
To help reproduce this issue I have created a SS 3.1 MySQL database dump that can be downloaded from https://stojg.se/assets/SS_sandboxdev.sql.gz (warning, it uses delete tables before import).
The live published site tree look like this:
Observe section 08 in the above image
If I in the 3.1 branch filters for all "Deleted pages" it looks like this:
As it can be seen, it's not possible to open Section 08 because it calculates the wrong number of children.
In the patches provided the same view looks like this:
Section 08 can now be opened and the deleted child page can be restored.
I have tested Groups, Folders and fields like TreeDropDown field.
Even if not all things marked as BUG in the description, the most important one was fixed (BUG: A shows up, but not “B”).
thanks @tractorcow for doing the peer review and merging.
How to recreate this bug:
First ensure that you have enough pages in the site tree so it doesn't pre-load all of your level two pages.
Observe that in the minimised site-tree shows A has a “Deleted” label, but no label on B
BUG: Observe that A and B is still showing (bug?)
Observe that A is showing, but not B
BUG: Observe that “A” doesn’t show up anymore
BUG: A shows up, but not “B” B cannot be found and restored any more?