Content
View differences
Updated by Niels Lindenthal over 10 years ago
When an issue contains journals with details noting a change in an attribute for which no JournalFormatter is defined, exporting the issue to pdf fails.
This is due to the fact that “nil” is returned when no formatter is defined. This can happen e.g. when the application is migrated from Redmine which causes the initial journals to contain changes like “created\_on” =\> \[nil, nil\]. This in itself is something which should not happen.
To reproduce create an issue and then add a “created\_on” =\> \[nil, nil\] to the initial journal. When following the “PDF” link the following stacktrace is returned:
TypeError (can't convert nil into String):
lib/redmine/export/pdf.rb:417:in `+'
lib/redmine/export/pdf.rb:417:in `issue_to_pdf'
lib/redmine/export/pdf.rb:416:in `each'
lib/redmine/export/pdf.rb:416:in `issue_to_pdf'
lib/redmine/export/pdf.rb:410:in `each'
lib/redmine/export/pdf.rb:410:in `issue_to_pdf'
app/controllers/issues_controller.rb:118:in `show'
This is due to the fact that “nil” is returned when no formatter is defined. This can happen e.g. when the application is migrated from Redmine which causes the initial journals to contain changes like “created\_on” =\> \[nil, nil\]. This in itself is something which should not happen.
To reproduce create an issue and then add a “created\_on” =\> \[nil, nil\] to the initial journal. When following the “PDF” link the following stacktrace is returned:
TypeError (can't convert nil into String):
lib/redmine/export/pdf.rb:417:in `+'
lib/redmine/export/pdf.rb:417:in `issue_to_pdf'
lib/redmine/export/pdf.rb:416:in `each'
lib/redmine/export/pdf.rb:416:in `issue_to_pdf'
lib/redmine/export/pdf.rb:410:in `each'
lib/redmine/export/pdf.rb:410:in `issue_to_pdf'
app/controllers/issues_controller.rb:118:in `show'