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

Fix search using OR aggregator for RT::Users #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elacour
Copy link

@elacour elacour commented Aug 19, 2020

Searching with:
[{"field":"EmailAddress","operator":"=","value":"xxx"},{"field":"Name","operator":"=","value":"xxxx","entry_aggregator": "OR"}]

doesn't works with RT::Users, at least, because this collection has
already default limits on Disabled field and PrincipalType:

(Principals_1.Disabled = '0') AND (Principals_1.PrincipalType = 'User')

So we need here parenthesis for the user requested query. I make the
subclause unconditionnal as it doesn't hurt simple queries and make
complex queries more robust.

Searching with:
[{"field":"EmailAddress","operator":"=","value":"xxx"},{"field":"Name","operator":"=","value":"xxxx","entry_aggregator": "OR"}]

doesn't works with RT::Users, at least, because this collection has
already default limits on Disabled field and PrincipalType:

   (Principals_1.Disabled = '0') AND (Principals_1.PrincipalType = 'User')

So we need here parenthesis for the user requested query. I make the
subclause unconditionnal as it doesn't hurt simple queries and make
complex queries more robust.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant