Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Explicitly set hidden values to nil

Dombi Attilad31e0ada308b
diff --git a/app/forms/custom_fields/inputs/base/input.rb b/app/forms/custom_fields/inputs/base/input.rb
index 2803e2b37a5..be796b04b79 100644
--- a/app/forms/custom_fields/inputs/base/input.rb
+++ b/app/forms/custom_fields/inputs/base/input.rb
@@ -54,12 +54,8 @@ class CustomFields::Inputs::Base::Input < ApplicationForm
)
end
- def value
- custom_value
- end
-
def custom_value
- @custom_value ||= @object.custom_value_for(@custom_field.id)
+ @custom_value ||= model.custom_value_for(@custom_field.id)
end
def invalid?
diff --git a/app/forms/custom_fields/inputs/base/utils.rb b/app/forms/custom_fields/inputs/base/utils.rb
index 2eb232a39ee..c0ef44233d9 100644
--- a/app/forms/custom_fields/inputs/base/utils.rb
+++ b/app/forms/custom_fields/inputs/base/utils.rb
@@ -50,7 +50,7 @@ module CustomFields::Inputs::Base::Utils
end
def value
- @custom_value
+ custom_value
end
def required?
diff --git a/app/forms/custom_fields/inputs/multi_select_list.rb b/app/forms/custom_fields/inputs/multi_select_list.rb
index a6245fcc235..221ca9b327c 100644
--- a/app/forms/custom_fields/inputs/multi_select_list.rb
+++ b/app/forms/custom_fields/inputs/multi_select_list.rb
@@ -37,7 +37,7 @@ class CustomFields::Inputs::MultiSelectList < CustomFields::Inputs::Base::Autoco
**input_attributes,
scope_name_to_model: false,
name: "#{@object.model_name.element}[custom_field_values][#{input_attributes[:name]}][]",
- value:
+ value: nil
)
custom_value_form.autocompleter(**input_attributes) do |list|
diff --git a/app/forms/custom_fields/inputs/multi_user_select_list.rb b/app/forms/custom_fields/inputs/multi_user_select_list.rb
index 0e93c3b920a..daa0f11d69e 100644
--- a/app/forms/custom_fields/inputs/multi_user_select_list.rb
+++ b/app/forms/custom_fields/inputs/multi_user_select_list.rb
@@ -39,7 +39,7 @@ class CustomFields::Inputs::MultiUserSelectList < CustomFields::Inputs::Base::Au
**input_attributes,
scope_name_to_model: false,
name: "#{@object.model_name.element}[custom_field_values][#{input_attributes[:name]}][]",
- value:
+ value: nil
)
custom_value_form.autocompleter(**input_attributes)
diff --git a/app/forms/custom_fields/inputs/multi_version_select_list.rb b/app/forms/custom_fields/inputs/multi_version_select_list.rb
index 11f7be1dd8f..62714744730 100644
--- a/app/forms/custom_fields/inputs/multi_version_select_list.rb
+++ b/app/forms/custom_fields/inputs/multi_version_select_list.rb
@@ -40,7 +40,7 @@ class CustomFields::Inputs::MultiVersionSelectList < CustomFields::Inputs::Base:
**input_attributes,
scope_name_to_model: false,
name: "#{@object.model_name.element}[custom_field_values][#{input_attributes[:name]}][]",
- value:
+ value: nil
)
custom_value_form.autocompleter(**version_input_attributes) do |list|