Actions
Bug #11768
closedSwitching organization or location fails with mass assignment security error
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Organizations and Locations
Target version:
-
Description
Switching organization or location in the host form has no effect. The call fails with:
| ActiveModel::MassAssignmentSecurity::Error (Can't mass-assign protected attributes: 0, new_interfaces): | app/models/concerns/foreman/sti.rb:22:in `new' | app/models/concerns/foreman/sti.rb:22:in `new_with_cast' | app/models/host/base.rb:75:in `initialize' | app/models/host/managed.rb:49:in `initialize' | app/models/concerns/foreman/sti.rb:22:in `new' | app/models/concerns/foreman/sti.rb:22:in `new_with_cast' | app/models/host.rb:15:in `method_missing' | app/controllers/hosts_controller.rb:538:in `process_taxonomy' | app/controllers/concerns/application_shared.rb:13:in `set_timezone' | app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | lib/middleware/catch_json_parse_errors.rb:9:in `call'
Users probably won't notice anything as the page is not refreshed and the error remains hidden.
This is related to fix for http://projects.theforeman.org/issues/9058 which was supposed to prevent host interfaces from being reset on the taxonomy change. Unfortunately it was fixed only by mistake, because the exception occurs before the code that used to clear the interfaces.
It needs to be fixed too.
Actions