Actions
Defect #39534
closedError (undefined method) in issue list PDF export
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
Hi,
I got an undefined method `custom_field' for nil:NilClass
error at https://www.redmine.org/projects/redmine/repository/svn/entry/tags/5.0.6/lib/redmine/export/pdf/issues_pdf_helper.rb#L342.
The error occurs when you try to PDF export a custom field block column that is not part of the tracker of the exported ticket(s). In that case issue.visible_custom_field_values
does not contain a custom value for the column, cv
is nil
and cv.custom_field
fails.
cv = issue.visible_custom_field_values.detect do |v| v.custom_field_id == column.custom_field.id end is_html = cv.custom_field.full_text_formatting?
Best regards,
Thomas
Updated by Thomas Löber 12 months ago
Here is a possible fix:
cv = issue.visible_custom_field_values.detect do |v| v.custom_field_id == column.custom_field.id end next if cv.nil? is_html = cv.custom_field.full_text_formatting?
Updated by Marius BĂLTEANU 12 months ago
- Status changed from New to Confirmed
- Assignee set to Marius BĂLTEANU
- Target version set to 5.0.7
Updated by Marius BĂLTEANU 12 months ago
- Status changed from Confirmed to Resolved
- Resolution set to Fixed
Fixed with a test, thanks for reporting the issue. The fix will be available in next maintenance releases.
Actions