Project

General

Profile

Actions

Defect #2584

closed

NameError

Added by Thomas Löber almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
2009-01-26
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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

Actions #1

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.

Actions #2

Updated by Jean-Philippe Lang almost 16 years ago

  • Status changed from New to Closed

Fixed in r2321.

Actions

Also available in: Atom PDF