TabInfo HasChildren falsely reports True with former child page(s) in the Recycle Bin
See original GitHub issueDescription of bug
When using the property TabInfo .HasChildren from code, if the page has a page or pages in the recycle bin that were previously children of that page, the HasChildren property will still be true.
Steps to reproduce
List the steps to reproduce the behavior
- Go to Content / Pages
- Add a page or two to an existing page
- Delete the new pages so they are in the recycle bin
- Add a quick RazorHost module to the page, run this script:
<p>Dnn.Tab.HasChildren = @Dnn.Tab.HasChildren</p>
Current result
HasChildren = True
Expected result
HasChildren = False
DNN Version [x] 9.3.2
Affected browser
All
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
PageTree Container.HasChildren is incorrect
There are situations where Container.HasChildren is false even though it should be true (there are child pages which the visitor can see).
Read more >Restore deleted items from the site collection recycle bin
A SharePoint site collection administrator can view and restore deleted items from the site collection Recycle Bin to their original locations. If an...
Read more >The AD Recycle Bin: Understanding, Implementing, Best ...
AD Recycle Bin (ADRB) was a long time coming and it definitely has its ... be “NOT TRUE”, as if the value is...
Read more >Frequent Questions on Recycling | US EPA
This is a list of frequent questions on recycling, broken down into five categories. These are answers to common questions that EPA has ......
Read more >Using the Recycle Bin
When you delete an asset, it isn't deleted. Instead, it's moved to the recycle bin. You can restore most assets from the recycle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sadly, I believe the current behavior is in fact correct. There are children tabs under the parent, it just so happens that the tab is deleted, however, it is a soft delete.
There are other situations in menu templates for example where the “HasChildren” property isn’t exactly proper either. For example, if all children have been hidden from the menu HasChildren would also be true, however, it would not have any items to include in a menu, etc.
Looking at your desired behavior, there is a real thought of a “HasVisibleChildren” property that would be helpful for menu construction.
I agree with @mitchelsellers, the best option would be a “hasActiveChildren”, which checks isdeleted, display dates and workflow states as well.