mirror of
https://github.com/redmine/redmine.git
synced 2025-11-18 03:00:52 +01:00
New custom fields of existing issues are not initialized with their default value (#21074).
git-svn-id: http://svn.redmine.org/redmine/trunk@14773 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -92,12 +92,12 @@ module Redmine
|
||||
if field.multiple?
|
||||
values = custom_values.select { |v| v.custom_field == field }
|
||||
if values.empty?
|
||||
values << custom_values.build(:customized => self, :custom_field => field, :value => nil)
|
||||
values << custom_values.build(:customized => self, :custom_field => field)
|
||||
end
|
||||
x.value = values.map(&:value)
|
||||
else
|
||||
cv = custom_values.detect { |v| v.custom_field == field }
|
||||
cv ||= custom_values.build(:customized => self, :custom_field => field, :value => nil)
|
||||
cv ||= custom_values.build(:customized => self, :custom_field => field)
|
||||
x.value = cv.value
|
||||
end
|
||||
x.value_was = x.value.dup if x.value
|
||||
|
||||
Reference in New Issue
Block a user