November Happy Hour will be moved to Thursday December 5th.

Strange behaviour of GetChildren method

Vote:
 

Hi,

I was faced with a strange behavior of the method IContentRepository.GetChildren.

Under start page I created 4 pages (1 published, 3 draft).

Site have only one enabled language. CMS version is 9.5.

And I don't understand, why LanguageLoaderOptions affect loading pages by theirs status.

I created test code


With options 1,2,3 I get published and draft pages, with options 3 I get only published pages.

Why does this happen?

#142780
Dec 23, 2015 8:09
Vote:
 

The "Fallback" option enables the language rules (as specified in the edit UI). Meaning it will try to find a published language, and apply fallback and replacement language. This option is what you normally want for rendering on a site.

Besides that you don't want drafts on the live site consider the scenario where you have a page that is published on english but a draft on swedish, then someone ask for swedish pages but have fallback to english. You would expect to render the english version on the site and not the swedish draft, that is one of the reasons the status is considered in the language rules.

In the other options you override the language rules, or with "FallbackWithMaster" you specify that you expect the master language back if the language rules failed to find a published language (this applies not only for drafts for missing translations as well).

#142781
Dec 23, 2015 10:15
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.