Defect #2584
closedNameError
0%
Description
When using IssuesController.send(:include, ...)
from a self-written plugin I get this error at Redmine startup:
[...]/vendor/rails/activesupport/lib/active_support/dependencies.rb:276:in `load_missing_constant': uninitialized constant Redmine::Export::PDF::FPDF (NameError)
from [...]/vendor/rails/activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
from [...]/lib/redmine/export/pdf.rb:25
The solution is to require 'rfpdf/fpdf'
in /lib/redmine/export/pdf.rb
:
Index: lib/redmine/export/pdf.rb =================================================================== --- lib/redmine/export/pdf.rb (Revision 2317) +++ lib/redmine/export/pdf.rb (Arbeitskopie) @@ -17,6 +17,7 @@ require 'iconv' require 'rfpdf/chinese' +require 'rfpdf/fpdf' module Redmine module Export
Updated by Thomas Löber almost 16 years ago
To be more precise:
The error is caused by the fact that the redmine_*
plugins are initialized before the rfpdf
plugin. If I access IssuesController
in my plugin's init.rb
Rails will automatically load /app/controllers/issues_controller.rb
which includes Redmine::Export::PDF
which, in turn, expects that the PDF libraries are already loaded.