Skip to content

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

Open
elacour wants to merge 1 commit into
bestpractical:masterfrom
Easter-eggs:subclause-for-json-query
Open

Fix search using OR aggregator for RT::Users#41
elacour wants to merge 1 commit into
bestpractical:masterfrom
Easter-eggs:subclause-for-json-query

Conversation

@elacour

@elacour elacour commented Aug 19, 2020

Copy link
Copy Markdown

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