Jump to content

Possible bug? Sub-selectors or pagefields not working when user is not logged in


Pierre-Luc
 Share

Recommended Posts

Has anyone seen this or could explain what could be wrong (on 2.4.0) ?

I have a page field which is a select for pages with the language template.
 
This is working either as a guest or logged-in user (tried with admin, not sure about others):
$discussions = $page->children("template=discussion, discussionLanguage=".$user->language);
 
While this is not when the user is a guest but works when logged in as admin:
$discussions = $page->children("template=discussion, discussionLanguage.title=".$user->language->title);
 
I'm not sure what's going on, this seems like a bug? While the first is valid, I would prefer to use the latter as I use a helper function to grab user languages with different variations according to the context:
function languageWithLocale($user) {
    return (string) $user->language->title; // typecast to string for usefulness
}
 
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...