Bug #16805
closedHost group change on host edit does not reload parameters etc.
Description
When editing a host and changing its host group, the parameters tab isn't reloaded with data coming from the new host group. If you save the host and revisit the page, the host group parameters are now shown.
The implementation of handleHostgroupChangeEdit in host_edit.js suggests that it should via the third part of this conditional:
244 function handleHostgroupChangeEdit(element, host_id, host_changed) { 1 if (host_changed){ 2 update_form(element,{data:"&host[id]="+host_id}) 3 } else if (host_changed == undefined) { // hostgroup changes parent 4 update_form(element) 5 } else { // edit host 6 set_inherited_value(element); 7 update_puppetclasses(element); 8 reload_host_params(); 9 } 10 }
Instead when the host group is changed, the second part (designed for the hostgroup#edit form, changing parent) is followed instead. This stems from the "data-type-changed" attribute being missing on the host form, due to Rails bug https://github.com/rails/rails/issues/24220, fixed in 5.0.0. In app/views/hosts/_form.html.erb, @host.type_changed?
may return nil, it should be !!@host.type_changed?
.
Updated by Dominic Cleal about 8 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
Updated by The Foreman Bot about 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3920 added
Updated by Dominic Cleal about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 2322228d6fe3b219d2ac7fa25d147ad49e9d1360.
Updated by Dominic Cleal about 8 years ago
- Translation missing: en.field_release set to 190