Bug #12194
closed
Can't search for multiple facts in foreman 1.10.0-RC1
Added by Timo Goebel about 9 years ago.
Updated over 6 years ago.
Description
Foeman 1.10.0 introduced a bug, that you can't search for multiple facts in the host overview (both via gui and api)
A search query like "facts.app_tier = prod and facts.project = abc" shows no results in 1.10, though there were a lot of results in 1.9.2.
Searching for "facts.app_tier = prod or facts.project = abc" works though.
Despite the fact that it changed previous behaviour, isn't this actually expected?
Marek Hulán wrote:
Despite the fact that it changed previous behaviour, isn't this actually expected?
I can't follow. Why should this be expected behavior? Searching for hosts by two or more facts seems a reasonable requirement for me. For example I might want to search for hosts that have jruby and mysql installed. This is an arbitrary example, but - unfortunately - currently broken.
Ah sorry, I misunderstood what you try to search for, I thought you were trying to search facts, not hosts. Ok, sounds as a valid bug.
- Related to Feature #11150: Allow searching of facts as types other than string added
- Translation missing: en.field_release set to 63
I believe this is happening when having a two joins on the same table, this was fixed in the past on scoped search at https://github.com/wvanbergen/scoped_search/commit/a7666e4b0a44cf1c066848cc8ab2f57301a7a218.
the solution should be to add aliases to table join, per condition set (name / value), however from a quick glance I'm not sure how to resolve it within the current implementation of external method.
AFAIR forcing a join should trigger the join aliasing code in scoped search.
I think the right way to solve it is probably via a patch to scoped_search, as there is no way to control the join statement from within the ext_method.
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2906 added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF