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

do not return an empty string

as-op38e924b0f378
diff --git a/app/models/work_package/exports/macros/attributes.rb b/app/models/work_package/exports/macros/attributes.rb
index d955a730e9b..37bbc2fecda 100644
--- a/app/models/work_package/exports/macros/attributes.rb
+++ b/app/models/work_package/exports/macros/attributes.rb
@@ -161,7 +161,7 @@ module WorkPackage::Exports
return msg_macro_error_rich_text if custom_field&.formattable?
attribute_name = convert_to_attribute_name(custom_field, attribute, obj)
- return "" unless can_view_attribute?(custom_field, obj, attribute_name)
+ return " " unless can_view_attribute?(custom_field, obj, attribute_name)
return msg_macro_error_rich_text if disabled_rich_text_fields.include?(attribute_name.to_sym)
format_attribute_value(attribute_name, obj.class, obj)
diff --git a/spec/models/work_package/pdf_export/common/macro_spec.rb b/spec/models/work_package/pdf_export/common/macro_spec.rb
index eead1725ffb..636a0850944 100644
--- a/spec/models/work_package/pdf_export/common/macro_spec.rb
+++ b/spec/models/work_package/pdf_export/common/macro_spec.rb
@@ -195,8 +195,8 @@ RSpec.describe WorkPackage::PDFExport::Common::Macro do
end
describe "without the permission" do
- it "outputs nothing" do
- expect(formatted).to eq("")
+ it "outputs a single space" do
+ expect(formatted).to eq(" ")
end
end
@@ -213,7 +213,7 @@ RSpec.describe WorkPackage::PDFExport::Common::Macro do
let(:project_phase_active) { false }
it "outputs the project phase name" do
- expect(formatted).to eq("")
+ expect(formatted).to eq(" ")
end
end
end