Project

General

Profile

Error #654

Access to nil on plugin settings view

Added by Emilio González Montaña over 12 years ago. Updated over 12 years ago.

Status:
Resolved
Priority:
Normal
Category:
Settings
Target version:
Start date:
2012-06-12
Due date:
2012-06-12
% Done:

100%

Estimated time:
Source:
Development
Detected on version:
Redmine version:
Redmine 1.4.3
Milestones:

Description

NoMethodError in Settings#plugin

Showing vendor/plugins/members_report/app/views/settings/_members_report_settings.rhtml where line #14 raised:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.collect

Extracted source (around line #14):

11: 
12: <%- issue_custom_fields = CustomField.find(:all, :conditions => "type = 'IssueCustomField'")
13:     issue_custom_fields_options = options_for_select(issue_custom_fields.collect{|c| [c.name, c.id]},
14:                                                      @settings["report_custom_fields"].collect{|t| t.to_i}) -%>
15: <p>
16:   <label><%= l(:label_setting_custom_issue_fields) %>:</label>
17:   <%= select_tag("settings[report_custom_fields]", issue_custom_fields_options, {:multiple => true}) %><br />

Trace of template inclusion: app/views/settings/plugin.html.erb

RAILS_ROOT: /Users/emilio/Documents/Desarrollo/redmine-1.4.3
Application Trace | Framework Trace | Full Trace

/Users/emilio/Documents/Desarrollo/redmine-1.4.3/vendor/plugins/members_report/app/views/settings/_members_report_settings.rhtml:14:in `_run_rhtml_vendor47plugins47members_report47app47views47settings47_members_report_settings46rhtml_locals_members_report_settings_object_settings'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable.rb:34:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable.rb:34:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/base.rb:306:in `with_template'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable.rb:30:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable_partial.rb:20:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:26:in `benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable_partial.rb:19:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/template.rb:205:in `render_template'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable_partial.rb:44:in `render_partial'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/partials.rb:184:in `render_partial'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/base.rb:267:in `render'
/Users/emilio/Documents/Desarrollo/redmine-1.4.3/app/views/settings/plugin.html.erb:6:in `_run_erb_app47views47settings47plugin46html46erb'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/helpers/capture_helper.rb:36:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/helpers/form_tag_helper.rb:469:in `form_tag_in_block'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/helpers/form_tag_helper.rb:39:in `form_tag'
/Users/emilio/Documents/Desarrollo/redmine-1.4.3/app/views/settings/plugin.html.erb:4:in `_run_erb_app47views47settings47plugin46html46erb'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable.rb:34:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable.rb:34:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/base.rb:306:in `with_template'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/renderable.rb:30:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/template.rb:205:in `render_template'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/base.rb:265:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/base.rb:348:in `_render_with_layout'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_view/base.rb:262:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:1252:in `render_for_file'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:936:in `render_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:51:in `render'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:51:in `render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:1328:in `default_render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:1334:in `perform_action_without_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/filters.rb:617:in `call_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/flash.rb:151:in `perform_action'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:532:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:532:in `process_without_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/filters.rb:606:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:391:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:386:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:438:in `call'

Request

Parameters:

{"id"=>"members_report"}

Show session dump
Response

Headers:

{"Content-Type"=>"text/html",
 "Cache-Control"=>"no-cache"}

Also available in: Atom PDF