DataFactory.GetChildren return zero results on page but not in CMS

2.1k views Asked by At

I have an odd issue that started appearing after upgrading EPiServer CMS 6 to EPiServer CMS 6 R2.

DataFactory.Instance.GetChildren(page.ParentLink);

The above code returns no children when I run it on the actual site but when I'm using the Editor mode and browse to the page, I get 36 results (which is correct). The datafactory works every other place on the site and it works perfectly for the Swedish site, however it doesn't work for any other language. I should point out that this worked in all languages before the site upgrade to CMS 6 R2.

I need those children! Any ideas?

2

There are 2 answers

1
russinkungen On BEST ANSWER

Managed to solve this by specifying the language branch in the call aswell. Didn't need to do this prior to Epi 6 R2 and I still think it's odd that it's working in Editor mode but not on the actual site.

DataFactory.Instance.GetChildren(page.ParentLink, new LanguageSelector(page.LanguageBranch));
1
tompipe On

Are the child pages published for those languages?

Does this help? It's for CMS 5 but the principle is the same.

http://labs.episerver.com/en/Blogs/Mari-Jorgensen/Dates/2009/2/Breaking-change-in-GetChildren/