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

Fix XLS export with empty activity

Oliver Günther56f6c926ebd8
diff --git a/modules/reporting/app/helpers/reporting_helper.rb b/modules/reporting/app/helpers/reporting_helper.rb
index 922a8f0861f..f9c1a418ea2 100644
--- a/modules/reporting/app/helpers/reporting_helper.rb
+++ b/modules/reporting/app/helpers/reporting_helper.rb
@@ -43,7 +43,7 @@ module ReportingHelper
def mapped(value, klass, default)
id = value.to_i
- return default if id < 0
+ return default if id <= 0
klass.find(id).name
end
diff --git a/modules/xls_export/lib/open_project/xls_export/xls_views.rb b/modules/xls_export/lib/open_project/xls_export/xls_views.rb
index abacbd84a2a..d4aac6ff420 100644
--- a/modules/xls_export/lib/open_project/xls_export/xls_views.rb
+++ b/modules/xls_export/lib/open_project/xls_export/xls_views.rb
@@ -12,7 +12,7 @@ class OpenProject::XlsExport::XlsViews
case key.to_sym
when :units then value.to_i
when :spent_on then value
- when :activity_id then mapped value, Enumeration, I18n.t(:caption_material_costs)
+ when :activity_id then mapped value, Enumeration, I18n.t('placeholders.default')
when :project_id then project_representation(value)
when :user_id, :assigned_to_id then user_representation(value)
when :work_package_id then work_package_representation(value)