Bug #31523
closedSearching for content view filter with just "inclusion_type" will return ISE
Description
This was seen because of the autocomplete search, to reproduce you can send something like:
curl -g -k -u admin:changeme -H "Content-Type: application/json" localhost:3000/katello/api/v2/content_view_filters?content_view_id=5&per_page=20&page=1&search=inclusion_type
Error:
2020-12-16T19:01:21 [I|app|94643dc4] Started GET "/katello/api/v2/content_view_filters?content_view_id=5&per_page=20&page=1&search=inclusion_type" for ::1 at 2020-12-16 19:01:21 +0000
2020-12-16T19:01:21 [I|app|94643dc4] Processing by Katello::Api::V2::ContentViewFiltersController#index as JSON
2020-12-16T19:01:21 [I|app|94643dc4] Parameters: {"content_view_id"=>"5", "per_page"=>"20", "page"=>"1", "search"=>"inclusion_type", "api_version"=>"v2"}
2020-12-16T19:01:21 [E|app|94643dc4] ActiveRecord::PreparedStatementInvalid: wrong number of bind variables (0 for 1) in: (["(\"katello_content_view_filters\".\"inclusion\" <> ?)", false])
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/sanitization.rb:209:in `raise_if_bind_arity_mismatch'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/sanitization.rb:166:in `replace_bind_variables'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/sanitization.rb:129:in `sanitize_sql_array'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/sanitization.rb:26:in `sanitize_sql_for_conditions'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/where_clause_factory.rb:14:in `build'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/query_methods.rb:656:in `where!'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/query_methods.rb:649:in `where'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/scoped_search-4.1.9/lib/scoped_search/definition.rb:329:in `block in register_named_scope!'
94643dc4 | /home/vagrant/katello/app/controllers/katello/api/v2/api_controller.rb:81:in `scoped_search'
94643dc4 | /home/vagrant/katello/app/controllers/katello/api/v2/content_view_filters_controller.rb:18:in `index'
94643dc4 | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
Updated by John Mitsch almost 4 years ago
- Blocks Tracker #29297: Content Publication Workflow added
Updated by Justin Sherrill almost 4 years ago
- Category set to Content Views
- Target version changed from Katello 4.1.0 to Katello 4.0.0
- Triaged changed from No to Yes
Updated by John Mitsch almost 4 years ago
- Target version changed from Katello 4.0.0 to Katello 4.1.0
Updated by Samir Jha over 3 years ago
- Target version changed from Katello 4.1.0 to Katello 4.2.0
Updated by Samir Jha over 3 years ago
- Target version changed from Katello 4.2.0 to Katello 4.3.0
Updated by The Foreman Bot about 3 years ago
- Status changed from New to Ready For Testing
- Assignee set to Samir Jha
- Pull request https://github.com/Katello/katello/pull/9770 added
Updated by The Foreman Bot about 3 years ago
- Fixed in Releases Katello 4.4.0 added
Updated by Samir Jha about 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|2079832287a023756f725d8d25cb2857a2cb193a.