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 missing long text custom field

as-op5d1d8c6ea5af
diff --git a/app/models/work_package/pdf_export/export/wp/attributes.rb b/app/models/work_package/pdf_export/export/wp/attributes.rb
index f1938b53ee4..7c2cb93a70d 100644
--- a/app/models/work_package/pdf_export/export/wp/attributes.rb
+++ b/app/models/work_package/pdf_export/export/wp/attributes.rb
@@ -128,6 +128,7 @@ module WorkPackage::PDFExport::Export::Wp::Attributes
parts = [current_part]
group.attributes.each do |form_key|
if allowed_long_text_custom_field?(form_key, work_package)
+ cf = form_key_to_custom_field(form_key)
if current_part[:type] == :long_text
current_part[:list] << cf
else
@@ -145,7 +146,7 @@ module WorkPackage::PDFExport::Export::Wp::Attributes
end
def allowed_long_text_custom_field?(form_key, work_package)
- return false if CustomField.custom_field_attribute? form_key
+ return false unless CustomField.custom_field_attribute? form_key
cf = form_key_to_custom_field(form_key)
return false if cf.nil?
diff --git a/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb b/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb
index eb52ec3ff6f..a24b0805f31 100644
--- a/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb
+++ b/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb
@@ -220,6 +220,7 @@ RSpec.describe WorkPackage::PDFExport::WorkPackageToPdf do
"DURATION", "1 d",
"Other",
"WORK PACKAGE CUSTOM FIELD BOOLEAN", "Yes",
+ "Work Package Custom Field Long Text", "foo faa",
"Costs",
"SPENT", "UNITS", "LABOR", "COSTS UNIT", "COSTS OVERALL", "COSTS BUDGET"
]
@@ -440,11 +441,11 @@ RSpec.describe WorkPackage::PDFExport::WorkPackageToPdf do
"Custom field boolean", I18n.t(:general_text_Yes),
"Custom field rich text", "[#{I18n.t('export.macro.rich_text_unsupported')}]",
"Custom field hidden",
- "No replacement of:",
- "projectValue:1:status",
"1", export_time_formatted, project.name,
+ "No replacement of:",
+ "projectValue:1:status",
"projectLabel:status",
"projectValue:2:status projectLabel:status",
"projectValue:3:status", "projectLabel:status",