Project

General

Profile

Actions

Bug #2513

closed

xmera Omnia - Collection #3597: Compatability maintenance for Rails 7 and RM 6

wiki#export (ActionView::Template::Error) "undefined method `[]' for nil:NilClass\n\n ...

Added by liaham 9 months ago. Updated 4 days ago.

Status:
Rejected
Priority:
Normal
Assignee:
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Affected Version:
Compatible Redmine Version:
5.1.z
Requires Documentation?:
No

Description

An ActionView::Template::Error occurred in wiki#export:



  undefined method `[]' for nil:NilClass



              annots << sprintf(' /Dest [%d 0 R /XYZ 0 %.2f null]', 1 + (2 * l[0]), @pagedim[l[0]]['h'] - (l[1] * @k))

                                                                              ^^^


  lib/redmine/export/pdf/wiki_pdf_helper.rb:38:in `wiki_pages_to_pdf'

  app/views/wiki/export.pdf.erb:1

  lib/redmine/sudo_mode.rb:61:in `sudo_mode'

  plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware.rb:56:in `call'

  • Parameters : {"controller"=>"wiki", "action"=>"export", "project_id"=>"some-project", "format"=>"pdf"}
Actions #1

Updated by liaham 9 months ago

  • Parent task set to #2512
Actions #2

Updated by liaham 9 months ago · Edited

The line raising the exception is in ruby gem rbpdf version 1.21.3 in RBPDF#putannotsobjs:

# rbpdf-1.21.3/lib/rbpdf.rb:6268
            else
              # internal link
              l = @links[pl['txt']] # <-- l must be nil to raise the error
              annots << sprintf(' /Dest [%d 0 R /XYZ 0 %.2f null]', 1 + (2 * l[0]), @pagedim[l[0]]['h'] - (l[1] * @k))
            end

These lines of code will only then be crossed when multiple wiki pages should be merged into a single pdf file.

pl is a hash with content like this: {"x"=>18.062575, "y"=>37.85658333333333, "w"=>23.460075, "h"=>3.175, "txt"=>1, "opt"=>{"subtype"=>"Link"}, "numspaces"=>0}.

The 'txt' variable comes from method RBPDF#Annotation(x, y, w, h, text, opt={'Subtype'=>'Text'}, spaces=0). It gets its params from RBPDF#Link what again gets the text param meanwhile called link from RBPDF#AddLink.

Actions #3

Updated by liaham 8 months ago

Unfortunately, the error is not reproducible.

Actions #4

Updated by liaham 7 months ago

  • Target version changed from 5.1.4 to 6.0.0
  • Parent task deleted (#2512)
Actions #5

Updated by liaham 19 days ago

  • Parent task set to #3597
Actions #6

Updated by liaham 4 days ago

  • Status changed from New to Rejected
  • Requires Documentation? set to No
  • Compatible Redmine Version 5.1.z added
  • Compatible Redmine Version deleted (n/a)

The error occurred in rbpdf gem: RBPDF#putannotsobjs which is super long and commented by the author that this method would not be completed.

Unfortunately, I cannot reproduce the error. Therefore, I will close this issue.

Actions

Also available in: Atom PDF