Defect #10505

Error when exporting to PDF with NoMethodError (undefined method `downcase' for nil:NilClass)

Added by Tommaso Visconti over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:HighDue date:
Assignee:-% Done:

0%

Category:PDF export
Target version:1.3.3
Resolution:Fixed Affected version:1.3.1

Description

When exporting a wiki page to PDF I receive this error (from production.log):

NoMethodError (undefined method `downcase' for nil:NilClass):
  lib/redmine/export/pdf.rb:120:in `RDMwriteHTMLCell'
  lib/redmine/export/pdf.rb:509:in `wiki_to_pdf'
  app/controllers/wiki_controller.rb:76:in `show'
  passenger (3.0.6) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  passenger (3.0.6) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  passenger (3.0.6) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
  passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
  passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
  passenger (3.0.6) lib/phusion_passenger/utils.rb:479:in `safe_fork'
  passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:180:in `start'
  passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
  passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
  passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
  passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
  passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
  passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
  passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.6) helper-scripts/passenger-spawn-server:99

Rendering /var/www/redmine-1.3.1/public/500.html (500 Internal Server Error)

I found a month-old report in the forum (http://www.redmine.org/boards/2/topics/29010) without any response.

I'm using Redmine 1.3.1.stable (MySQL)

wiki.txt Magnifier - Affected wiki page (4.61 KB) Tommaso Visconti, 2012-03-27 14:00

Associated revisions

Revision 9278
Added by Toshi MARUYAMA over 5 years ago

pdf: backport r8731 (#10505)

Fixed that tag0 may be nil.

History

#1 Updated by Jun NAITOH over 5 years ago

I can't reproduce.
I need more information.

  • your Ruby version
  • your account's language setting. ( general_pdf_encoding is UTF-8?)
  • a reproducible wiki format text.

#2 Updated by Tommaso Visconti over 5 years ago

This bug doesn't affect all the pages.

  • ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
  • The language is italian and:
    $ grep -r general_pdf_encoding config/locales/it.yml 
      general_pdf_encoding: UTF-8
    

Attached you find the affected wiki page code

#3 Updated by Tommaso Visconti over 5 years ago

I found what's wrong, it's this the '<' char in the '<==>' string (in the first table):

|_.Switch|_.Porta|_.<==>|_.Switch|_.Porta|
|<.[[Cisco G200-26]]|<.25|=.<==>|<.[[HP Procurve 1400-24G]]|<.24|
|<.[[Cisco G200-26]]|<.26|=.<==>|<.Kraun gigabit|<.5|
|<.Kraun gigabit|<.1|=.<==>|<.3Com|<.16|

Without this char it can print pdf correctly

#4 Updated by Jun NAITOH over 5 years ago

I can reproduced, thanks.
If "<" was included on wiki format, this problem occurred.
This problem already fixed on trunk by r8731 .

#5 Updated by Toshi MARUYAMA over 5 years ago

  • Category changed from Wiki to PDF export

#6 Updated by Toshi MARUYAMA over 5 years ago

  • Status changed from New to Closed
  • Target version set to 1.4.0
  • Resolution set to Fixed

I committed r9278 to 1.3-stable.
If Redmine 1.3.3 is released, we need to change target to 1.3.3.

#7 Updated by Toshi MARUYAMA over 5 years ago

  • Target version changed from 1.4.0 to 1.3.3

Also available in: Atom PDF