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

fixed caching all paths in formula_references_id?

Ivan Kuchin3c5f0a701a6a
diff --git a/app/models/custom_field/calculated_value.rb b/app/models/custom_field/calculated_value.rb
index 63a6043ec22..50f9f8c6db8 100644
--- a/app/models/custom_field/calculated_value.rb
+++ b/app/models/custom_field/calculated_value.rb
@@ -131,10 +131,12 @@ module CustomField::CalculatedValue
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)
-
- ProjectCustomField.where(id: referenced_custom_fields).any? do |referenced_field|
- referenced_field.formula_references_id?(original_id, cache)
+ if referenced_custom_fields.include?(original_id) || referenced_custom_fields.include?(id)
+ true
+ else
+ ProjectCustomField.where(id: referenced_custom_fields).any? do |referenced_field|
+ referenced_field.formula_references_id?(original_id, cache)
+ end
end
else
false