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

handle custom fields in journals#diff

Ivan Kuchin953488f46be0
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index d7ea7714252..2482b17cfb8 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -108,11 +108,14 @@ class JournalsController < ApplicationController
end
def valid_field_for_diffing?
- %w[description status_explanation].include?(field_param) || agenda_item_notes?
- end
-
- def agenda_item_notes?
- field_param.match?(/\Aagenda_items_\d+_notes\z/)
+ case field_param
+ when "description",
+ "status_explanation",
+ /\Aagenda_items_\d+_notes\z/
+ true
+ when /\Acustom_fields_(?<id>\d+)\z/
+ ::CustomField.exists?(id: Regexp.last_match[:id], field_format: "text")
+ end
end
def journals_index_title