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

Use escaped formatted value

Oliver Günther4de17dc71d35
diff --git a/modules/reporting/app/helpers/reporting_helper.rb b/modules/reporting/app/helpers/reporting_helper.rb
index 28f717337dd..ac76405a08a 100644
--- a/modules/reporting/app/helpers/reporting_helper.rb
+++ b/modules/reporting/app/helpers/reporting_helper.rb
@@ -121,7 +121,7 @@ module ReportingHelper
when :version_id then h(Version.find(value.to_i).name)
when :singleton_value then ''
when :status_id then h(Status.find(value.to_i).name)
- when /custom_field\d+/ then custom_value(key, value)
+ when /custom_field\d+/ then h(custom_value(key, value))
else h(value.to_s)
end
end
@@ -133,7 +133,7 @@ module ReportingHelper
# and then properly cast the value
CustomValue
.new(custom_field_id: cf_id, value:)
- .typed_value
+ .formatted_value
end
def field_sort_map(key, value)
diff --git a/modules/reporting/spec/helpers/reporting_helper_spec.rb b/modules/reporting/spec/helpers/reporting_helper_spec.rb
index 840a206c588..18eea612dae 100644
--- a/modules/reporting/spec/helpers/reporting_helper_spec.rb
+++ b/modules/reporting/spec/helpers/reporting_helper_spec.rb
@@ -63,7 +63,7 @@ RSpec.describe ReportingHelper do
it 'returns the option value' do
expect(field_representation_map("custom_field#{custom_field.id}", 3.0))
- .to be 3.0
+ .to eq "3.0"
end
end
end