Matoseb Posted February 6, 2022 Share Posted February 6, 2022 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 More sharing options...
Matoseb Posted February 6, 2022 Author Share Posted February 6, 2022 Ok apparently the pages created from a PageReference field have languages non-active by default. I activate the languages with a hook on page added. Now it works Link to comment Share on other sites More sharing options...
MSP01 Posted May 3, 2022 Share Posted May 3, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now