Actions
Bug #16855
closedos_selected override breaks hosts form
Description
Katello needs to override os_selected to post additional params via AJAX call. Data posted with this override has unexpected format and results in the following:
2016-10-11T03:45:57 48049ca6 [app] [I] Started POST "/hosts/os_selected" for ::1 at 2016-10-11 03:45:57 -0400 2016-10-11T03:45:57 48049ca6 [app] [I] Processing by HostsController#os_selected as */* 2016-10-11T03:45:57 48049ca6 [app] [I] Parameters: {"operatingsystem_id"=>"6", "organization_id"=>"2", "location_id"=>"", "content_view_id"=>"", "lifecycle_environment_id"=>"", "content_source_id"=>"", "architecture_id"=>"1", "hostgroup_id"=>"", "medium_id"=>"", "kickstart_repository_id"=>""} 2016-10-11T03:45:57 48049ca6 [app] [D] Setting current user thread-local variable to admin 2016-10-11T03:45:58 48049ca6 [app] [D] Setting current organization thread-local variable to ColdCubeCorp 2016-10-11T03:45:58 48049ca6 [app] [D] Setting current location thread-local variable to none 2016-10-11T03:45:58 48049ca6 [app] [D] Setting current organization thread-local variable to ColdCubeCorp 2016-10-11T03:45:58 48049ca6 [app] [D] Setting current location thread-local variable to none 2016-10-11T03:45:58 48049ca6 [app] [D] Setting current location thread-local variable to none 2016-10-11T03:45:58 48049ca6 [app] [D] Setting current organization thread-local variable to ColdCubeCorp 2016-10-11T03:45:58 48049ca6 [app] [I] Completed 500 Internal Server Error in 25ms (ActiveRecord: 3.6ms) 2016-10-11T03:45:58 48049ca6 [app] [F] | NoMethodError (undefined method `has_key?' for nil:NilClass): | app/controllers/concerns/foreman/controller/parameters/keep_param.rb:11:in `block in keep_param' | app/controllers/concerns/foreman/controller/parameters/keep_param.rb:10:in `each' | app/controllers/concerns/foreman/controller/parameters/keep_param.rb:10:in `inject' | app/controllers/concerns/foreman/controller/parameters/keep_param.rb:10:in `keep_param' | app/controllers/concerns/foreman/controller/parameters/host.rb:34:in `host_params' | app/controllers/concerns/foreman/controller/host_details.rb:57:in `item_params' | app/controllers/concerns/foreman/controller/host_details.rb:50:in `block in assign_parameter' | app/models/taxonomy.rb:65:in `block (2 levels) in as_taxonomy' | app/models/concerns/foreman/thread_session.rb:147:in `as_location' | app/models/taxonomy.rb:64:in `block in as_taxonomy' | app/models/concerns/foreman/thread_session.rb:112:in `as_org' | app/models/taxonomy.rb:63:in `as_taxonomy' | app/controllers/concerns/foreman/controller/host_details.rb:49:in `assign_parameter' | app/controllers/concerns/foreman/controller/host_details.rb:14:in `os_selected' | app/controllers/concerns/application_shared.rb:14:in `set_timezone' | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | lib/middleware/catch_json_parse_errors.rb:8:in `call' | lib/middleware/tagged_logging.rb:18:in `call'
Params should have format { "host" => {"operatingsystem_id" => "6", ... } }
Actions