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 bug with reference properties in queries #1886

Merged
merged 4 commits into from
Feb 8, 2019

Conversation

TW80000
Copy link

@TW80000 TW80000 commented Feb 7, 2019

I noticed the query owner=101 wasn't working in the general search box in the DAO controller, which is supposed to be a valid MQL query. I looked into it and noticed that since the property owner was defined via a relationship, it was a Reference, not a Long. The query parser was only recognizing numeric properties by checking if they were an instance of foam.core.Int, so it was treating all Reference properties as containing string values. Therefore the query parser was generating an IN_IC(OWNER, ["101"]) mlang instead of EQ(OWNER, 101).

This commit fixes that issue by checking if the property is a reference to a long property and if so, treating its value as a number, not a string.

I did a full-project search for other places we might be doing the same thing and only found one place, so it's presumably fixed there as well.

…int were being treated as strings instead of ints
@TW80000 TW80000 self-assigned this Feb 7, 2019
@kgrgreer kgrgreer merged commit e9c395c into master Feb 8, 2019
@TW80000 TW80000 deleted the fix-reference-property-query-bug branch February 8, 2019 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants