Defect #9778
closed
No route matches controller knowledgebase
Added by Mario Luzeiro about 13 years ago.
Updated almost 12 years ago.
Description
My redmine was workin in rev8131, now I update for last trunk (8191) and seams to be a problem with "knowledgebase" plugin.
Processing WelcomeController#index (for 192.168.3.70 at 2011-12-12 10:04:21) [GET]
Parameters: {"action"=>"index", "controller"=>"welcome"}
Rendering template within layouts/base
Rendering welcome/index
Rendering welcome/news
Rendering welcome/projects
ActionView::TemplateError (No route matches {:controller=>"knowledgebase", :action=>"index"}) on line #35 of app/views/layouts/base.html.erb:
32: 'div',
33: "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe,
34: :id => 'loggedas') if User.current.logged? %>
35: <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
36: </div>
37:
38: <div id="header">
lib/redmine/menu_manager.rb:237:in `render_single_menu_node'
lib/redmine/menu_manager.rb:189:in `render_menu_node'
lib/redmine/menu_manager.rb:178:in `render_menu'
lib/redmine/menu_manager.rb:255:in `menu_items_for'
lib/redmine/menu_manager.rb:252:in `each'
lib/redmine/menu_manager.rb:252:in `menu_items_for'
lib/redmine/menu_manager.rb:177:in `render_menu'
app/views/layouts/base.html.erb:35
Files
It appears that r8157 broke this plugin. The following patch resolves the issue, but since they've removed the default routes, they're is likely a better long-term fix:
diff --git a/config/routes.rb b/config/routes.rb
index 8b40a4f..15c10a6 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -256,7 +256,8 @@ ActionController::Routing::Routes.draw do |map|
end
map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get}
-
+ map.connect ':controller/:action/:id'
+
# Used for OpenID
map.root :controller => 'account', :action => 'login'
end
I found that there are problems with other all my plugins in my system. It apears first with "knowledgebase" plugin because it is the first plugin to load, I remove it and then, there are other same like problems.
I have merged back (revert) to r8141 and everything is back to normal (I hope!)
You only have to add back the default route (':controller/:action/:id'
) in your config/routes.rb
file as Alex suggested and everything will work as before.
I'm assuming that any plugins that hook into the menu are going to have this issue. Is there a better (official) solution to this than patching the routes?
This has nothing to do with the menu; the cleanest way to deal with routes for plugins, just as Redmine core, is to declare them explicitly in their own config/routes.rb
and to use the correct Redmine routes.
The problem with the default route is that it allows the use of several ways to the same controller action which is potentially not safe and is error prone, see fixed code in core because of this removal.
- Status changed from New to Closed
- Resolution set to Invalid
Issue is not related to the Redmine core; closing as such. Thanks for all the input on this matter.
- Status changed from Closed to Reopened
And what we shall do?
r8162 completely brake many plugins installed!
- Status changed from Reopened to Closed
Ask plugin authors to fix them?
Etienne Massip wrote:
Ask plugin authors to fix them?
While I'm grateful that I finally found this thread, I've wasted many hours after upgrading to Redmine 1.4 trying to work out why some of my plugins stopped working. Couldn't this be prominently displayed in the upgrading documentation or something? What a huge waste of time for something so trivial...
- Status changed from Closed to Reopened
Yes, please can we put this in the 1.4 documentation. It took me several hours to find this thread.
Also, we should add a note to the 1.4 docs telling the plugin developers what to add to the
plugins so this workaround will not be needed. While this is otherwise the Right Thing to do,
it does break lots of existing plugins, and it needs to be documented and broadcast appropriately.
I encounter the same problem with redmine_delete_project plugin.
But I could fix the problem adding route.rb under config.
- Status changed from Reopened to Closed
Currently, (most of) the changes are described at Plugins.
Koji Chikamoto wrote:
I encounter the same problem with redmine_delete_project plugin
Thanks for posting.
Alex Bevilacqua wrote:
Note that the plugin should be fully functional with Redmine 1.4.x (and 2.x.x) now, so this item can be closed.
I agree, will do.
Marc Mengel wrote:
Yes, please can we put this in the 1.4 documentation [...]
See above.
Brad Rushworth wrote:
[...] Couldn't this be prominently displayed in the upgrading documentation or something? [...]
I agree that plugin API changes should be documented better. Maybe some sort of list, as in e.g. Security Advisories, could improve this a little. It can be a default footnote in release announcements. Just an idea...
List maintenance requires resources though, so someone (I continually am still very limited regarding available spare time, so I can't deliver the needed resources here) needs to monitor core code changes, filter plugin API changes and document them properly as long as Jean-Philippe Lang focuses more on coding.
Disclaimer: To be clear, I am writing this on my personal behalf. This does not reflect any community nor development team or whatsoever.
Also available in: Atom
PDF