Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subfield selector unexpectedly returns result in OR like fashion #1438

Open
ruudalberts opened this issue Oct 7, 2015 · 3 comments
Open

Comments

@ruudalberts
Copy link

The selector "template=accommodationtype,availability.column=1194,availability.row=1889,availability.value=1"
should return all accommodationtypes where all availability restrictions match: availablity.column = 1194 AND availability.row=1887 AND availability.value=1

What actually happends (looking at the querylog), is that the availability field is joined 3 times, matching all 3 subfields seperately, then grouping the result and thus returning all accommodationtypes where either of the restrictions are met:

More info and a proposed fix here: https://processwire.com/talk/topic/11099-subfield-selector-unexpectedly-returning-result-in-or-like-fashion/

@ryancramerdesign
Copy link
Owner

What type of field is "availability"? (Page field?). Are any of your subfields: "column", "row", or "value" able to contain multiple values? For instance, might they be Page fields or Options fields?

@ryancramerdesign
Copy link
Owner

I'm wondering if you might be looking for the @field.subfield grouping that we introduced in PW 2.5? See here: https://processwire.com/blog/posts/processwire-2.5-changelog/#selectors-and-finding-pages

@ruudalberts
Copy link
Author

Hi Ryan,

I already added a comment on this in the forumtopic: https://processwire.com/talk/topic/11099-subfield-selector-unexpectedly-returning-result-in-or-like-fashion/?p=104303

Do your prefer to keep the conversation on the forums, or here on github?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants