question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TabInfo HasChildren falsely reports True with former child page(s) in the Recycle Bin

See original GitHub issue

Description 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

  1. Go to Content / Pages
  2. Add a page or two to an existing page
  3. Delete the new pages so they are in the recycle bin
  4. 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:closed
  • Created 4 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
mitchelsellerscommented, Jul 5, 2019

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.

1reaction
sleupoldcommented, Jul 5, 2019

I agree with @mitchelsellers, the best option would be a “hasActiveChildren”, which checks isdeleted, display dates and workflow states as well.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found