Project

General

Profile

Actions

Bug #16805

closed

Host group change on host edit does not reload parameters etc.

Added by Dominic Cleal about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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?.

Actions #1

Updated by Dominic Cleal about 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal
Actions #2

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
Actions #3

Updated by Dominic Cleal about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Dominic Cleal about 8 years ago

  • Translation missing: en.field_release set to 190
Actions

Also available in: Atom PDF