zouchaoqun / ezlibrarian

book shelf and device room management plugin for redmine
http://ezwork.techcon.thtf.com.cn
16 stars 12 forks source link

Action Controller::RoutingError on redmine 2.x #5

Open jeff-dagenais opened 9 years ago

jeff-dagenais commented 9 years ago

First, thanks for this simple, yet quite useful plugin.

So on a fresh install, plugin migration occurs without failures, but when I enable the module on a project, any access to this project fails with:

ActionController::RoutingError (No route matches {:project_id=>#<Project id: 37, name: "DFD Programer", description: "", homepage: "", is_public: true, parent_id: nil, created_on: "2012-05-17 13:25:28", updated_on: "2012-05-17 13:25:28", identifier: "dfdprogramer", status: 1, lft: 1, rgt: 2, inherit_members: false>, :controller=>"treasures"}):
  lib/redmine/menu_manager.rb:150:in `render_single_menu_node'
  lib/redmine/menu_manager.rb:102:in `render_menu_node'
  lib/redmine/menu_manager.rb:91:in `block in render_menu'
  lib/redmine/menu_manager.rb:168: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'
  lib/redmine/menu_manager.rb:80:in `render_main_menu'
  app/views/layouts/base.html.erb:45:in `_app_views_layouts_base_html_erb___471412471512513224_46630640'

Many redmine plugins made prior to 1.4(I believe) have suffered from the same issue. The updated redmine tutorial (http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial#Adding-routes) mentions that routing needs to be configured in config/routes.rb. I am a programmer but I am not familiar with ruby or rails at all. Can you guess/suggest what route should be added for the plugin to work? I will fork your repo, make the changes, debug as much as I can, test it and send a merge request later.

jeff-dagenais commented 9 years ago

I just saw there are 9 forks already, some mention updating for redmine 2.x! I will check that out, and report back.