-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
6.9.0
-
False
-
-
False
-
CLOSED
-
3,500
-
Endeavour
-
-
-
Moderate
-
None
Description of problem:
If a child host group attribute is not currently inherit from the parent host group. The selection option will show the incorrect "inherit parent" value.
Steps to Reproduce:
1. In web ui, Create a parent host group and set the "Deploy On" to a compute resource. For example, "Brisbane Vcenter"
2. In web ui, Create a child host group and set the "Deploy On" to a different compute resource. For example, "Sydney Vcenter".
3. After creating the child host group. Edit the child host group, click the "Deploy on" select box
Actual results:
It is showing "Inherit parent (Sydney Vcenter)".
Expected results:
It should be showing "Inherit parent (Brisbane Vcenter)
Additional info:
Make the following change seems to fix the issue
— a/helpers/form_helper.rb 2021-09-09 16:22:49.684921775 +1000
+++ b/helpers/form_helper.rb 2021-09-09 16:23:05.679076650 +1000
@@ -345,7 +345,7 @@
def blank_or_inherit_f(f, attr, blank_value: _("no value"))
return true unless f.object.respond_to?(:parent_id) && f.object.parent_id
- inherited_value = f.object.send(attr)
+ inherited_value = f.object.respond_to?(:nested) ? f.object.nested(attr) : f.object.send(attr)
inherited_value = inherited_value.name_method if inherited_value.present? && inherited_value.respond_to?(:name_method)
inherited_value ||= blank_value
_("Inherit parent (%s)") % inherited_value