プロジェクト

全般

プロフィール

Vote #68475

完了

ActionView::TemplateError (undefined method `empty?' for nil:NilClass) on line #12 of app/views/context_menus/issues.html.erb:

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
開始日:
2010/10/27
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
25
issue_org_id:
6750
author_id:
3906
assigned_to_id:
1188
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
24
ステータス-->[Closed]

説明

Visiting this URL always results in a 500 internal server error. The error in the production log has been attached.
http://dev.somedomain.com/issues/context_menu

I found this problematic URL after a search engine navigated to it, and reported it as a problem.

Using::
Redmine 1.0.2
Rails 2.3.5
MySQL 5.1.49
Phusion passenger 2.2.11
Ruby 1.8.7.299

Processing ContextMenusController#issues (for 192.168.1.1 at 2010-10-26 18:59:35) [GET]
  Parameters: {"action"=>"issues", "controller"=>"context_menus"}
Rendering context_menus/issues

ActionView::TemplateError (undefined method `empty?' for nil:NilClass) on line #12 of app/views/context_menus/issues.html.erb:
9:              :class => 'icon-edit', :disabled => !@can[:edit] %>
10: <% end %>
11: 
12:   <% unless @allowed_statuses.empty? %>
13:     
  • 14: <%= l(:field_status) %> 15:
      app/views/context_menus/issues.html.erb:12 app/controllers/context_menus_controller.rb:36:in `issues' /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request' /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /usr/lib/phusion_passenger/passenger-spawn-server:61 Rendering /home/user/domains/dev.somedomain.com/public_html/public/500.html (500 Internal Server Error)

  • journals

    Thanks for the bug report.

    It's easier if you post the error message into the body of the issue so someone doesn't have to download the file to see the error.
    --------------------------------------------------------------------------------
    Noted. :)
    --------------------------------------------------------------------------------
    Two problems at first sight:
    * we should use @blank?@ everywhere, which works with @nil@, whereas @empty?@ doesn't
    * we should refine HTTP method usable for this action ; today context_menu is accessed through POST, so GET could be blocked at routing level, but we should switch to GET and don't use POST if we want to follow REST principles

    I'll look at the first one before tomorrow, but second one won't be addressed in 1.0.3 I think.
    --------------------------------------------------------------------------------
    Jean-Baptiste Barth wrote:
    > Two problems at first sight:
    > * we should use @blank?@ everywhere, which works with @nil@, whereas @empty?@ doesn't

    +1, or if it's a negative like here use @present?@ and change the @unless@ to an @if@ (@if @allowed_statuses.present?@)

    > * we should refine HTTP method usable for this action ; today context_menu is accessed through POST, so GET could be blocked at routing level, but we should switch to GET and don't use POST if we want to follow REST principles

    I think GET is better. Since the parameters passed to the context menu don't change anything on the server, GET is safe. Should we open a new issue for this?

    --------------------------------------------------------------------------------
    Eric Davis wrote:
    > I think GET is better. Since the parameters passed to the context menu don't change anything on the server, GET is safe. Should we open a new issue for this?

    Yes, I'll do.
    --------------------------------------------------------------------------------
    Original problem fixed in r4302. I'll open new issues for the other things we mentionned.
    --------------------------------------------------------------------------------
    Merged into 1.0-stable for release in 1.0.3
    --------------------------------------------------------------------------------

    Admin Redmine さんが3年以上前に更新

    • カテゴリIssues_2 にセット
    • 対象バージョン1.0.3_25 にセット

    他の形式にエクスポート: Atom PDF

    いいね!0
    いいね!0