Skip to content

Ensure filter_manager.add doesn't freak out if there's a custom filter present#8038

Closed
samcday wants to merge 1 commit intoelastic:masterfrom
atlassian:atlassian/fix-filter-bug
Closed

Ensure filter_manager.add doesn't freak out if there's a custom filter present#8038
samcday wants to merge 1 commit intoelastic:masterfrom
atlassian:atlassian/fix-filter-bug

Conversation

@samcday
Copy link

@samcday samcday commented Aug 20, 2016

filterManager.add assumes that if it finds a filter that has a query prop, then it must also have a match contained in that query.

We have custom filters that are using term queries and range queries and the like. Once you have a saved search with any bespoke filters like that, you can no longer add new filters by clicking the little +🔍 icon next to a field in the results.

This fixes it.

@elasticmachine
Copy link
Contributor

Can one of the admins verify this patch?

@samcday
Copy link
Author

samcday commented Aug 20, 2016

I don't know if Atlassian has signed the CLA. Frankly, for a one-liner fix I'm not sure I can be bothered poking the internal bureaucracy to make that happen. Can a core dev just feel a sudden surge of inspiration to fix this bug independently of this PR? :)

@epixa epixa added the help wanted adoptme label Aug 20, 2016
Bargs pushed a commit to Bargs/kibana that referenced this pull request Aug 22, 2016
filterManager.add assumes that if it finds a filter that has a query
prop, then it must also have a match clause contained in that query.

User created custom filters may use term queries, range queries and
the like. Once you've added any filters without a match clause like that,
you can no longer add new filters by clicking the "add filter" icon
next to a field in the results. Instead you'll get an error that says
"Cannot read property '<your-prop>' of undefined" when filterManager.add
iterates over your custom filter with no match key.

Fixes: elastic#7246
Related: elastic#8038
Bargs added a commit to Bargs/kibana that referenced this pull request Aug 22, 2016
filterManager.add assumes that if it finds a filter that has a query
prop, then it must also have a match clause contained in that query.

User created custom filters may use term queries, range queries and
the like. Once you've added any filters without a match clause like
that,
you can no longer add new filters by clicking the "add filter" icon
next to a field in the results. Instead you'll get an error that says
"Cannot read property '<your-prop>' of undefined" when filterManager.add
iterates over your custom filter with no match key.

Fixes: elastic#7246
Related: elastic#8038
@Bargs
Copy link
Contributor

Bargs commented Aug 22, 2016

Thanks for the contribution @samcday, I've recreated your change here #8049

@Bargs Bargs closed this Aug 22, 2016
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.

4 participants

Comments