New plugin controller error
Added by Zach Hamman over 11 years ago
So, I have created plugins in the past no problem. I am using Redmine 1.4.x and used script/generate redmine_plugin team_email to scaffold the plugin. I created the controller, added the routes, etc. But I received this error:
ArgumentError in Team mailController#index wrong number of arguments (1 for 0) /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:532:in `send' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:532:in `process_without_filters' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/filters.rb:606:in `process' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:391:in `process' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/base.rb:386:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:438:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:87:in `dispatch' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:121:in `_call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/string_coercion.rb:25:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/string_coercion.rb:25:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/head.rb:9:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/params_parser.rb:15:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/session/abstract_store.rb:177:in `call' /Users/zhamman/.gem/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call' /Users/zhamman/.gem/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /Users/zhamman/.gem/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:9:in `cache' /Users/zhamman/.gem/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:28:in `call' /Users/zhamman/.gem/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `synchronize' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:114:in `call' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/reloader.rb:34:in `run' /Users/zhamman/.gem/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:108:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/urlmap.rb:47:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/urlmap.rb:41:in `each' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/urlmap.rb:41:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rails-2.3.14/lib/rails/rack/log_tailer.rb:17:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/content_length.rb:13:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/chunked.rb:15:in `call' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/handler/mongrel.rb:67:in `process' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run' /Users/zhamman/.gem/ruby/1.8/gems/rack-1.1.6/lib/rack/handler/mongrel.rb:38:in `run' /Users/zhamman/.gem/ruby/1.8/gems/rails-2.3.14/lib/commands/server.rb:111 script/server:3:in `require' script/server:3
I have run the debugger in Netbeans on that line for a working plugin controller and standard redmine controller with no issues. It is as if the controller cannot find the "perform_action" method. Any ideas?
Replies (2)
RE: New plugin controller error - Added by Zach Hamman over 11 years ago
Whatever this issue, it seems to be related to send(). I edited ActionController::Base.process to statically call perform_action if the method variable is set to that. The error occurs again when send is called on the first before_filter callback.
RE: New plugin controller error - Added by Zach Hamman over 11 years ago
Never mind. I'm dumb and had another function called send that was overriding the default Object.send() method