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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use the custom_values method in the custom field forms instead of the error prone instance variable.
Dombi Attila0967c26609ff
diff --git a/app/forms/custom_fields/inputs/base/input.rb b/app/forms/custom_fields/inputs/base/input.rbindex be796b04b79..ce0c22e84e7 100644--- a/app/forms/custom_fields/inputs/base/input.rb+++ b/app/forms/custom_fields/inputs/base/input.rb@@ -48,8 +48,7 @@ class CustomFields::Inputs::Base::Input < ApplicationFormdef input_attributesbase_input_attributes.merge({- data: { "qa-field-name": qa_field_name },- value:+ data: { "qa-field-name": qa_field_name }})enddiff --git a/app/forms/custom_fields/inputs/multi_select_list.rb b/app/forms/custom_fields/inputs/multi_select_list.rbindex 221ca9b327c..bccbfd57958 100644--- a/app/forms/custom_fields/inputs/multi_select_list.rb+++ b/app/forms/custom_fields/inputs/multi_select_list.rb@@ -64,7 +64,7 @@ class CustomFields::Inputs::MultiSelectList < CustomFields::Inputs::Base::Autoco{label: item.ancestry_path,value: item.id,- selected: @custom_values.pluck(:value).map(&:to_i).include?(item.id)+ selected: custom_values.pluck(:value).map(&:to_i).include?(item.id)}endelse@@ -85,8 +85,8 @@ class CustomFields::Inputs::MultiSelectList < CustomFields::Inputs::Base::Autocoenddef selected?(custom_option)- if @custom_values.any?- @custom_values.pluck(:value).map { |value| value&.to_i }.include?(custom_option.id)+ if custom_values.any?+ custom_values.pluck(:value).map { |value| value&.to_i }.include?(custom_option.id)elsecustom_option.default_value?enddiff --git a/app/forms/custom_fields/inputs/multi_user_select_list.rb b/app/forms/custom_fields/inputs/multi_user_select_list.rbindex daa0f11d69e..83f9012d8e4 100644--- a/app/forms/custom_fields/inputs/multi_user_select_list.rb+++ b/app/forms/custom_fields/inputs/multi_user_select_list.rb@@ -56,6 +56,6 @@ class CustomFields::Inputs::MultiUserSelectList < CustomFields::Inputs::Base::Auenddef custom_input_value- @custom_values.filter_map(&:value)+ custom_values.filter_map(&:value)endenddiff --git a/app/forms/custom_fields/inputs/multi_version_select_list.rb b/app/forms/custom_fields/inputs/multi_version_select_list.rbindex 62714744730..a0cc71131b0 100644--- a/app/forms/custom_fields/inputs/multi_version_select_list.rb+++ b/app/forms/custom_fields/inputs/multi_version_select_list.rb@@ -62,7 +62,7 @@ class CustomFields::Inputs::MultiVersionSelectList < CustomFields::Inputs::Base:enddef selected?(version)- @custom_values.pluck(:value).map { |value| value&.to_i }.include?(version.id)+ custom_values.pluck(:value).map { |value| value&.to_i }.include?(version.id)enddef group_key(project)