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

FindPagesWithCriteria searches only in default language?

Vote:
 

Hi

We built a mirror-function in EPiserver which uses FindPagesWithCriteria to find all pages which match a "MasterPage"-property on pages in our different sites. This function stoped working once we upgraded to EPiServer CMS6 R2. To test the function I created a new page in Indian-english language on our Indian site and then set its MasterPage-property to an english page which was published on our main-site.
The problem was that FindPagesWithCriteria only found two other pages on other sites which was previously published. I did notice that these pages were in the language which was the same as the Page I was trying to mirror, i.e. en-GB, but it didn't find the page which I earlier had created in en-IN language. After this I tried the FindPagesWithCriteria with the same parameters but I added that it should also use the "en-IN"-language. This time it actually found the pages on the Indian site which it was supposed to find.

My Question is, did EPiServer change the way FindPagesWithCriteria works in CMS 6 and as default it only search for pages which is of the same language as the page I'm publishing?
In CMS 5, findpageswithcriteria actually found all pages in all languages which had their MasterPage-property set to the pageId of the published page.

#54144
Oct 04, 2011 11:57
Vote:
 

Guess you found the solution allready, otherwise check here:

http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=54208&epslanguage=en

use FindPagesWithCriteria overload that takes languageBranch and set it to null!

#55457
Dec 02, 2011 8:41
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.