Defect #4600

Issue list export to PDF - NoMethodError (undefined method `cf_3' for #XXXX) when issues sorted by a custom field

Added by Andrew Leaf about 13 years ago. Updated about 13 years ago.

Status:ClosedStart date:2010-01-18
Priority:NormalDue date:
Assignee:-% Done:


Target version:0.9.1
Resolution:Fixed Affected version:0.9.0


When attempting to export issues to a PDF that are sorted by a custom field, an Internal 500 Server error is displayed to the user. The production.log shows that an undefined method being the cause.

Environment -

Found in RC1 0.9, Ruby 1.8.6, Rails 2.3.5, Rack 1.0.1, mysql
User language is English.

Steps to reproduce -

  1. Install RC 1 of 0.9 from RubyForge
  2. Create several issues
  3. Create a custom field
  4. View the issue list
  5. Group the results by that custom field
  6. Export the issue list to PDF
  7. Observe the Internal server 500 error is displayed to the user

Note - Log file excerpted below.

Expected Result -

User should be able to export issues to PDF when grouped by a custom field.

Processing IssuesController#index (for XXXXXXXX at 2010-01-18 10:57:58) [POST]
  Parameters: {"project_id"=>"administration", "group_by"=>"cf_3", "set_filter"=>"1", "fields"=>["status_id"], "action"=>"index", "authenticity_token"=>"XXXXXXXXXXXXX=", "operators"=>{"start_date"=>"<t+", "created_on"=>">t-", "watcher_id"=>"=", "estimated_hours"=>"=", "cf_4"=>"=", "updated_on"=>">t-", "cf_6"=>"=", "priority_id"=>"=", "subject"=>"~", "tracker_id"=>"=", "done_ratio"=>"=", "due_date"=>"<t+", "assigned_to_id"=>"=", "author_id"=>"=", "status_id"=>"o"}, "controller"=>"issues", "values"=>{"start_date"=>[""], "created_on"=>[""], "watcher_id"=>["me"], "estimated_hours"=>[""], "cf_4"=>[""], "updated_on"=>[""], "cf_6"=>[""], "priority_id"=>["10"], "subject"=>[""], "tracker_id"=>["2"], "done_ratio"=>[""], "due_date"=>[""], "assigned_to_id"=>["me"], "author_id"=>["me"], "status_id"=>["10"]}, "query"=>{"column_names"=>["tracker", "status", "priority", "subject", "author", "assigned_to", "updated_on"]}, "_"=>""}
Rendering issues/index.rhtml
Completed in 166ms (View: 116, DB: 18) | 200 OK [http://cXXXXXXXXXXX/issues?set_filter=1]

Processing IssuesController#index to pdf (for at 2010-01-18 10:58:00) [GET]
  Parameters: {"format"=>"pdf", "project_id"=>"administration", "action"=>"index", "controller"=>"issues"}

NoMethodError (undefined method `cf_3' for #<Issue:0xb6ffa4f4>):
  lib/redmine/export/pdf.rb:149:in `send'
  lib/redmine/export/pdf.rb:149:in `issues_to_pdf'
  lib/redmine/export/pdf.rb:148:in `each'
  lib/redmine/export/pdf.rb:148:in `issues_to_pdf'
  app/controllers/issues_controller.rb:79:in `index'
  app/controllers/issues_controller.rb:75:in `index'

Rendering /XXXXXXXXX/redmine/public/500.html (500 Internal Server Error)

Associated revisions

Revision 3333
Added by Jean-Philippe Lang about 13 years ago

Fixed: PDF export of a issue list grouped by a custom field raises an error (#4600).


#1 Updated by Andrew Leaf about 13 years ago

Original description and bug subject should have used the word "Grouped" and not "sorted".

The problem is with grouping.

#2 Updated by Jean-Philippe Lang about 13 years ago

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

Fixed in r3333.

Also available in: Atom PDF