edtsech / redmine_wiki_permissions

This redmine plugin adding permissions for every wiki page (need a maintainer)
32 stars 16 forks source link

undefined method `level' for nil:NilClass #7

Open bwc opened 14 years ago

bwc commented 14 years ago

This is on redmine r3683 and the latest version of this plugin. I think the error happens when a user does a search of all project wiki's and there is a wiki page under permissions control in a project that the user is not a member of.

A NoMethodError occurred in search#index:

undefined method level' for nil:NilClass [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:103:inuser_permission_greater?'


Request:


Session:


Environment:


Backtrace:

[RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:103:in user_permission_greater?' [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:120:incan_view?' [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:13:in index' [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:11:indelete_if' [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:11:in index' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:insend' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:incall_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in ms' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:inrealtime' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'

aerojustaero commented 14 years ago

Same bug

Installed latest stable redmine and latest version of plugin

Some users getting same error while searching.

pauleil commented 14 years ago

Similar problem here: half of our users get Error 500 when the plugin is installed. Usually these are users that were Reporters at some point and were promoted to Developers. Removing the plugin solves the problem. Here is the production.log output:

Processing SearchController#index (for 192.1.2.3 at 2010-06-23 18:14:38) [GET] Parameters: {"action"=>"index", "q"=>"now", "controller"=>"search"}

NoMethodError (undefined method level' for nil:NilClass): passenger (2.2.14) lib/phusion_passenger/rack/request_handler.rb:92:inprocess_request' passenger (2.2.14) lib/phusion_passenger/abstract_request_handler.rb:207:in main_loop' passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:441:instart_request_handler' passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:381:in handle_spawn_application' passenger (2.2.14) lib/phusion_passenger/utils.rb:252:insafe_fork' passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:377:in handle_spawn_application' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:insend' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in main_loop' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:196:instart_synchronously' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:163:in start' passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:222:instart' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:262:in spawn_rails_application' passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:126:inlookup_or_add' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:256:in spawn_rails_application' passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:80:insynchronize' passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:79:in synchronize' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:255:inspawn_rails_application' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:154:in spawn_application' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:287:inhandle_spawn_application' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in __send__' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:inmain_loop' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

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

And here is the output of ruby script/about : Ruby version 1.8.7 (i386-freebsd7) RubyGems version 1.3.7 Rack version 1.2 Rails version 2.3.5 Active Record version 2.3.5 Active Resource version 2.3.5 Action Mailer version 2.3.5 Active Support version 2.3.5 Edge Rails revision unknown Application root /path/to/redmine Environment development Database adapter postgresql Database schema version 20100407184912

About your Redmine plugins Redmine Local Avatars plugin 0.0.2 Forward to Diffs 0.1 Google Calendar Plugin 0.1.2 Scrumdashboard plugin 1.2 Stuff To Do Plugin 0.4.0 Redmine Codebook plugin 0.2.1 Redmine Code Review plugin 0.3.1 Redmine Bugcloud plugin 0.0.2.1 Redmine Wiki Issue Details plugin 0.1.0 Redmine Todo Lists plugin 0.0.4.1 Latex Wiki-macro Plugin 0.0.3 Single Project Forward 0.1 Redmine Wiki Extensions plugin 0.2.2 Bots filter 1.02 Bulk Time Entry 0.5.0 Redmine Graphs plugin 0.1.0 Redmine Wiki Permissions plugin 0.0.1 Redmine Drafts plugin 0.1.1 Timesheet Plugin 0.6.0 Redmine Version Burndown Charts plugin 0.0.5 Redmine Issue History Tabs plugin 0.0.2 Issue Due Date 0.1.0 Redmine Stealth plugin 0.1.0 Redmine Require Closing Note plugin 0.0.1 Redmine Charts 0.1.0 Redmine Question plugin 0.3.0

pauleil commented 14 years ago

Any updates on this? Still doesn't work in 1.0.1 (Error 500 for some users)