Project

General

Profile

Bug #7146

Unable to LIKE (~) filter on classes (v1.5.2)

Added by Rickard von Essen almost 6 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Search
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

I'm running foreman 1.5.2 with the PR for #7035 (PR:1692).

When I search for parts of a class name. For example: class ~ activemq
I always get all hosts back. This is similar to #7035 except this ~ instead of =.

The production log contains the following SQL:

Started GET "/hosts?utf8=%E2%9C%93&search=class+%7E+activemq" for 192.168.233.119 at 2014-08-19 11:42:25 +0200
Processing by HostsController#index as HTML
  Parameters: {"utf8"=>"✓", "search"=>"class ~ activemq"}
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
Setting current user thread-local variable to admin
  Host::Managed Load (0.3ms)  SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`type` IN ('Host::Managed') LIMIT 1
   (0.2ms)  SELECT COUNT(*) FROM `user_facts` WHERE `user_facts`.`user_id` = 1
  Host::Managed Load (0.4ms)  SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`type` IN ('Host::Managed') ORDER BY `hosts`.`name` ASC LIMIT 20 OFFSET 0
  Operatingsystem Load (0.3ms)  SELECT `operatingsystems`.* FROM `operatingsystems` WHERE `operatingsystems`.`id` IN (1, 2) ORDER BY operatingsystems.name
  Environment Load (0.3ms)  SELECT `environments`.* FROM `environments` WHERE `environments`.`id` IN (6, 5) ORDER BY environments.name
  Model Load (0.2ms)  SELECT `models`.* FROM `models` WHERE `models`.`id` IN (1) ORDER BY models.name
   (0.3ms)  SELECT MAX(`reports`.`id`) AS maximum_id, host_id AS host_id FROM `reports` WHERE `reports`.`host_id` IN (2, 3, 4, 5) GROUP BY host_id
  Rendered hosts/_list.html.erb (24.8ms)
  Rendered hosts/index.html.erb within layouts/application (28.7ms)
  Bookmark Load (0.4ms)  SELECT `bookmarks`.* FROM `bookmarks` WHERE (((bookmarks.public = 1) OR (bookmarks.owner_id = 1 AND bookmarks.owner_type = 'User'))) AND (controller = 'hosts') ORDER BY name
  Rendered common/_searchbar.html.erb (6.2ms)
  Rendered home/_user_dropdown.html.erb (1.7ms)
Read fragment views/tabs_and_title_records-1 (95.0ms)
  Rendered home/_topbar.html.erb (98.0ms)
  Rendered layouts/base.html.erb (99.8ms)
Completed 200 OK in 153ms (Views: 136.0ms | ActiveRecord: 2.6ms)

History

#1 Updated by Tomer Brisker almost 3 years ago

  • Status changed from New to Resolved

Tested with current develop (1.16). this works correctly.

Also available in: Atom PDF