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

[#64348] Assign value in fetch

Tobias Dillmann6bf7db3a1f7b
diff --git a/app/models/custom_field/calculated_value.rb b/app/models/custom_field/calculated_value.rb
index 22729ce9a8a..c92b041a8a1 100644
--- a/app/models/custom_field/calculated_value.rb
+++ b/app/models/custom_field/calculated_value.rb
@@ -100,17 +100,17 @@ module CustomField::CalculatedValue
def formula_references_id?(original_id, cache = {})
cache.fetch(id) do
- if field_format_calculated_value?
- referenced_custom_fields = formula_referenced_custom_field_ids
+ cache[id] = if field_format_calculated_value?
+ referenced_custom_fields = formula_referenced_custom_field_ids
- next true if referenced_custom_fields.include?(original_id) || referenced_custom_fields.include?(id)
+ next true if referenced_custom_fields.include?(original_id) || referenced_custom_fields.include?(id)
- ProjectCustomField.where(id: referenced_custom_fields).any? do |referenced_field|
- referenced_field.formula_references_id?(original_id, cache)
- end
- else
- false
- end
+ ProjectCustomField.where(id: referenced_custom_fields).any? do |referenced_field|
+ referenced_field.formula_references_id?(original_id, cache)
+ end
+ else
+ false
+ end
end
end