Project

General

Profile

Actions

Defect #9778

closed

No route matches controller knowledgebase

Added by Mario Luzeiro about 13 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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

redmine_delete_project.tar.gz (3.34 KB) redmine_delete_project.tar.gz Koji Chikamoto, 2012-12-31 19:28

Related issues

Has duplicate Redmine - Defect #9822: ActionView::TemplateError (No route matches {:controller=>"rb_all_projects", :action=>"server_variables"})Closed

Actions
Actions #1

Updated by Alex Bevilacqua about 13 years ago

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
Actions #2

Updated by Alex Bevilacqua about 13 years ago

I meant r8162 in the above comment (not r8157)

Actions #3

Updated by Mario Luzeiro about 13 years ago

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!)

Actions #4

Updated by Etienne Massip about 13 years ago

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.

Actions #5

Updated by Alex Bevilacqua about 13 years ago

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?

Actions #6

Updated by Etienne Massip about 13 years ago

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.

Actions #7

Updated by Mischa The Evil almost 13 years ago

  • 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.

Actions #8

Updated by Roland Discein almost 13 years ago

  • Status changed from Closed to Reopened

And what we shall do?
r8162 completely brake many plugins installed!

Actions #9

Updated by Etienne Massip almost 13 years ago

  • Status changed from Reopened to Closed

Ask plugin authors to fix them?

Actions #10

Updated by Brad Rushworth over 12 years ago

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...

Actions #11

Updated by Marc Mengel over 12 years ago

  • 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.

Actions #12

Updated by Alex Bevilacqua over 12 years ago

Note that the plugin should be fully functional with Redmine 1.4.x (and 2.x.x) now, so this item can be closed.

https://github.com/alexbevi/redmine_knowledgebase

Actions #13

Updated by Koji Chikamoto almost 12 years ago

I encounter the same problem with redmine_delete_project plugin.
But I could fix the problem adding route.rb under config.

Actions #14

Updated by Mischa The Evil almost 12 years ago

  • 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.

Actions

Also available in: Atom PDF