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.

Variant Children of non-variant node are not listed

See original GitHub issue

Testing 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:26 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
Shazwazzacommented, Jul 19, 2019

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:

            // invariant has invariant value (whatever the requested culture)
            if (!content.ContentType.VariesByCulture() && culture != "*")
                culture = "";

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:

0reactions
JoseMarcenarocommented, Sep 24, 2020

@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

Read more comments on GitHub >

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

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