Variant Children of non-variant node are not listed
See original GitHub issueTesting and PR notes: https://github.com/umbraco/Umbraco-CMS/issues/5886#issuecomment-513100527
Release 8.1.0 includes some breaking changes regarding IPublishedContent.Children()
- gone - and its replacement properties .Children
and .ChildrenForAllCultures
(see this discussion).
But it looks like the implementation does not work as expected:
If you have a non-variant parent with a mix of culture-variant and non-variant children:
- Only the non-variant children are listed in the
Children
property. - The culture-variant children are not listed, even if they have a published version in the current language.
- The related methods
.FirstChild()
,.FirstChild<T>()
, etc. also fail to retrieve any culture-variant children.
The only way to access the culture-variant children is the ChildrenForAllCultures
property. I don’t think this is by design, is it?
This item has been added to our backlog AB#1721
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:26 (19 by maintainers)
Top Results From Across the Web
how to publish only non default language variant content
I'm using Umbraco 8.1.3 (same thing with 8.1.5). Steps: Create Document Type; Enable vary by culture; Add 1 invariant property ...
Read more >requireNativeComponent: "RNSScreen" was not found in ...
Faced the same issue while implementing Navigation. Run following commands npm install @react-navigation/native. React Navigation is made up ...
Read more >Root node can't find it's children. Not sure why. : r/godot
your editor shows how your nodes will be arranged when you run the scene. however, the moment it runs the children do not...
Read more >CS 621 Spring 2018: Homework 2. Dynamic analysis
write ups should be individual, not created jointly, and written in the student's own words. ... Like a binary tree, it consists of...
Read more >non leaf node in binary tree
Following are the types of Binary Tree based on the number of children: 1. As far as I understand, each time I need...
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 Free
Top 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
Here’s a PR https://github.com/umbraco/Umbraco-CMS/pull/5946
The problem was the odd logic in PublishedContentExtensions.Children where it did this:
I’m actually unsure why this logic exists and it may actually be a copy/paste problem. This similar logic exists in the Name and UrlSegment methods but in those methods it makes sense since they are returning single values. Perhaps @zpqrtbnk has some thoughts on that.
You can see in the PR that I’ve removed this logic which fixes these issues. I’ve added unit tests to prove this (these were failing before adding the fix). Please also have a look at the code comments/notes I’ve added.
For testing:
@brahim19 - please open a thread in https://our.umbraco.com/forum/ to get help on this issue with your code, as it is not an Umbraco issue. Thx