Matoseb Posted February 6, 2022 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!
Matoseb Posted February 6, 2022 Author 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
MSP01 Posted May 3, 2022 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?
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