Defect #16887 » RM_16887_details_to_strings_reloads_custom_fields_many_times.diff
| app/helpers/issues_helper.rb (copie de travail) | ||
|---|---|---|
| 220 | 220 |
options[:only_path] = (options[:only_path] == false ? false : true) |
| 221 | 221 |
strings = [] |
| 222 | 222 |
values_by_field = {}
|
| 223 |
# Specific : do not reload the custom field multiple time |
|
| 224 |
cfs = {}
|
|
| 223 | 225 |
details.each do |detail| |
| 224 | 226 |
if detail.property == 'cf' |
| 225 | 227 |
field_id = detail.prop_key |
| 226 |
field = CustomField.find_by_id(field_id) |
|
| 228 |
# Specific |
|
| 229 |
field = cfs[field_id] |
|
| 230 |
if field.nil? |
|
| 231 |
field = CustomField.find_by_id(field_id) |
|
| 232 |
cfs[field_id] = field |
|
| 233 |
end |
|
| 234 |
# END -- Specific |
|
| 235 | ||
| 227 | 236 |
if field && field.multiple? |
| 228 | 237 |
values_by_field[field_id] ||= {:added => [], :deleted => []}
|
| 229 | 238 |
if detail.old_value |