FindPagesWithCriteria in CMS 6 R2

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 which, in this case, 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.

#54208
Oct 05, 2011 11:12
Vote:
 

Have you tried to use the overload of FindPagesWithCriteria that takes in both an languageBranch and a language selector?

In that overload languageBranch parameter controls which languages to search in (null means all) and the language selector is used to control which language version to return in the result set.

#54277
Oct 07, 2011 13:50
Vote:
 

Hi

Ofcourse the solution was that simple. I added null as language-branch and voilá in found 12 pages in 10 different languages instead of only finding in en-GB. Thank you very much!

#54311
Oct 10, 2011 8:54
Vote:
 

Jepp happend to me too, is this documented as a change in R2? It worked earlier in CMS 6.0

#57118
Feb 27, 2012 14:24
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.