Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redmine 1.4 error #14

Closed
xadh00m opened this issue Apr 17, 2012 · 8 comments
Closed

Redmine 1.4 error #14

xadh00m opened this issue Apr 17, 2012 · 8 comments

Comments

@xadh00m
Copy link

xadh00m commented Apr 17, 2012

After upgrading to 1.4 I encounter the following error:

ActionView::TemplateError (No route matches {:controller=>"stealth", :action=>"toggle"}) on line #30 of app/views/layouts/base.html.erb:
27:


28:

29:

30: <%= render_menu :account_menu -%>
31:

32: <%= content_tag(
33: 'div',

lib/redmine/menu_manager.rb:102:in `render_menu_node'
lib/redmine/menu_manager.rb:91:in `render_menu'
lib/redmine/menu_manager.rb:168:in `menu_items_for'
lib/redmine/menu_manager.rb:165:in `each'
lib/redmine/menu_manager.rb:165:in `menu_items_for'
lib/redmine/menu_manager.rb:90:in `render_menu'
app/views/layouts/base.html.erb:30
app/views/layouts/admin.html.erb:8
passenger (3.0.8) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
passenger (3.0.8) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.8) /helper-scripts/passenger-spawn-server:99
@xadh00m
Copy link
Author

xadh00m commented Apr 19, 2012

I´ve created a fix following the suggestions from here:http://www.redmine.org/issues/10699#change-37538

Its necessary to add a new file config/routes.rb with the following content:


ActionController::Routing::Routes.draw do |map|
map.connect '/stealth/toggle', :controller => 'stealth', :action => 'toggle'
end


That fixes the issue.

@marton78
Copy link

Thanks, the fix works great. Would be nice if the author could include this file.

@cs42
Copy link

cs42 commented Jun 12, 2012

For me decide_toggle_display doesn't work any longer on Redmine 1.4.3. I changed the :if parameter of the menu entry in init.rb to Proc.new{ User.current.logged? and User.current.allowed_to?({:controller => 'stealth', :action => 'toggle'}, nil, :global => true) }

@xadh00m
Copy link
Author

xadh00m commented Jun 12, 2012

Hm, the latest update to 1.4.3 workes fine for me without any additional changes (except the routes.rb file mentioned in the beginning). Did you get a particular error in this codeline?

@cs42
Copy link

cs42 commented Jun 13, 2012

Maybe it is not a problem with Redmine 1.4 but that I switched to ruby 1.9.3 as well. The error was an Template error but the real culprit was calling the test. I'll give you the exact error message later...

@cs42
Copy link

cs42 commented Jun 13, 2012

Ok, as suspected it's a problem with ruby 1.9.3. Using the original test for :ifresults in

ActionView::TemplateError (wrong number of arguments (1 for 0)) on line #30 of app/views/layouts/base.html.erb:
27: <div id="wrapper2">
28: <div id="top-menu">
29:     <div id="account">
30:         <%= render_menu :account_menu -%>
31:     </div>
32:     <%= content_tag(
33:            'div',

    vendor/plugins/redmine-stealth-plugin/init.rb:27:in `block (3 levels) in evaluate_init_rb'
    lib/redmine/menu_manager.rb:196:in `call'
    lib/redmine/menu_manager.rb:196:in `allowed_node?'
    lib/redmine/menu_manager.rb:166:in `block in menu_items_for'
    lib/redmine/menu_manager.rb:165:in `each'
    lib/redmine/menu_manager.rb:165:in `menu_items_for'
    lib/redmine/menu_manager.rb:90:in `render_menu'
    app/views/layouts/base.html.erb:30
    <internal:prelude>:10:in `synchronize'
    <internal:prelude>:10:in `synchronize'

The new code seems to work with ruby 1.8.7 and 1.9.3, though.

@teleological
Copy link
Owner

Thanks to @xadh00m for the routing patch. Applying in v0.4.0. I'm also seeing the problem @cs42 notes as I upgrade my installation from Redmine v0.9.0 (!) to v1.4.3, using Ruby 1.9.3-p125. I'm looking into that now.

@teleological
Copy link
Owner

The second problem is due to a change in the behavior of lambda in Ruby 1.9. In 1.8, lambda Procs ignore it when they are called with undeclared arguments; in 1.9, an error is raised. Fixing in v0.4.0.

teleological added a commit that referenced this issue Jun 16, 2012
* Updated version to 0.4.0
* Fix issue #4: Lookup translation for error message
* Fix issue #14: Routes and Ruby 1.9 compatibility
** Added config/routes.rb with stealth#toggle route
** Fixed Ruby 1.9 lambda Proc strict arguments issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants