Project

General

Profile

Actions

Bug #9097

closed

Typo in value_to_sql method causes ext_method searches with LIKE to not be applied

Added by David Davis almost 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Search
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Found a bug here:

https://github.com/theforeman/foreman/blob/ee1f56de6b2bdca4dfd104b99ec25340bfb51aaa/app/models/concerns/scoped_search_extensions.rb#L7

I believe that should be ~= instead of ~. The reason we're not seeing any bugs? Looks like it's being rescued here:

https://github.com/wvanbergen/scoped_search/blob/v2.7.1/lib/scoped_search/query_builder.rb#L371

To test, I think this should reproduce the problem:

1. Create a host
2. Try to filter by one of the affected search scopes (e.g. 'user_id = 999999'). Make sure you use '=' in your search.

Your host should still be visible when it ought not to be.

Actions

Also available in: Atom PDF