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

GetChildren not returning children

Vote:
 

Hi

I've run into some unexpected behaviour with my EPi Server CMS 8.0.0.

The thing is that when I try to get children for a specific page. The children are not returned unless they have been loaded previously. I can load the children in edit mode by expanding the parent node or by debugging and getting a child, using the Immediate Window.

I've tried ContentLoader, ContentRepository and EPiServer.DataFactory.Instance.GetChildren. They all have the same problem.

  • I have a page that has a couple of children. When getting the page's children I set a breakpoint.
  • With the execution halted I run calls to GetChildren methods on ContentLoader, ContentRepository and DataFactory. They all return zero children.
  • I load one of the children using (new PageReference()).GetPage()
  • I re-run the methods in step 2 and they all return that ONE child i just loaded. The other children are still missing.

If I expand the children of the page in edit mode once, they are returned in step 2 above. After recycling the AppPool the problem appears again.

Have any of you seen this?
Any ideas on how to solve it?

Site is protected by forms authentication. I have access to the pages (admin). The pages are published. It is a multi-lingual site.

Note: 

EPiServer.DataFactory.Instance.GetChildren(pageReference, LanguageSelector.AutoDetect(true)) returns children but only in the master language (swedish). 
EPiServer.DataFactory.Instance.GetChildren(pageReference, new LanguageSelector("en")) returns no children. 
EPiServer.DataFactory.Instance.GetChildren(pageReference, new LanguageSelector("sv")) returns children.

This code is executed in the context of an System.Web.Http.ApiController. The requested language is passed as a query parameter. Could it be that the current culture is not set correctly?

Please advice.
/Martin 


 


                    
#133356
Sep 02, 2015 14:26
Vote:
 

Is this problem isolated to ApiControllers? Do you experience the same problem if you run the code from a page template?

#133445
Sep 04, 2015 15:59
Vote:
 

Hi Martin,

This seems to be related to the same problem discussed here http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=118482

It was reported as a bug and fixed in version 8.4.0 http://world.episerver.com/support/Bug-list/bug/123201

#133451
Sep 04, 2015 18:55
Vote:
 

Alf: Thanks for your help! Yes, unfortunately it behaves the same way inside a PageController.

Andreas: Thanks for that link! Upgrading to 8.11.0 solved it! 

#133719
Sep 09, 2015 13:06
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.