Bug #2045
closederror when searching a host by class
Description
The filter was "class = nis::server" leading to this url: https://foreman/hosts?utf8=%E2%9C%93&search=class+%3D+nis%3A%3Aserver
and this error message:
ActiveRecord::StatementInvalid
PG::Error: ERROR: invalid input syntax for integer: "nil" LINE 1: SELECT "hosts".* FROM "hosts" WHERE ((hosts.id = 'nil')) OR... ^ : SELECT "hosts".* FROM "hosts" WHERE ((hosts.id = 'nil')) ORDER BY "hosts"."name" ASC NULLS FIRST LIMIT 20 OFFSET 0
app/controllers/hosts_controller.rb:41:in `index'
app/controllers/hosts_controller.rb:37:in `index'
lib/foreman/threadsession.rb:31:in `clear_thread'
when trying "class = 'nis::server'" (note the extra quotes) no error is thrown and the host list is not filtered.
I would have expected the query to return all hosts that have the nis::server class assigned (directly or transitively).
This is foreman 1.1RC1 running on Scientific Linux 6.2 with the packages from yum.theforeman.org
Updated by Ohad Levy about 12 years ago
- Category set to Search
- Assignee set to Joseph Magen
- Target version set to 1.1
Updated by Joseph Magen about 12 years ago
- Status changed from New to Ready For Testing
I send pull request at https://github.com/theforeman/foreman/pull/310
Should we removed all single quotes in the search value??
value = value.gsub(/'/,"")
Updated by Anonymous about 12 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 2c01421b778af7e3b8bcc511d14eea374c82fb9a.