Jump to content

Cannot find pages in non-default language, based on their PageReference entries


Matoseb
 Share

Recommended Posts

Hello!

I'm trying to find pages that contains a specific page in their PageReference field (named page_reference_category).

user()->language = 'default';
bd($pages->find("page_reference_category=[id=1269], include=all"));
// logs 1 entry

user()->language = 'anglais';
bd($pages->find("page_reference_category=[id=1269], include=all"));
// logs 0 entry

This works well with the default language (french) but not in other languages which return no entries.

Note: My whole code is based on the user's chosen language.

 

Thanks for the help!

Link to comment
Share on other sites

  • 2 months later...

I recently ran into the same problem. I tried to auto-activate the other languages in a saveReady hook, but it didn't work even though changing the hidden status inside the same hook works fine. Anyone got any advice on this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...