Project

General

Profile

Actions

Defect #22048

closed

Exception throws during plugin rendering

Added by Andrey Iskousnykh almost 9 years ago. Updated almost 6 years ago.

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

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

The following code in redmine\app\views\layouts\base.html.erb at 28th line will throw ActionController::UrlGenerationError when plugin has controller with namespace in routing.

<%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>

A part from route.rb of plugin:

RedmineApp::Application.routes.draw do
  #...
  get 'projects/:project_id/reports/admin'
  #...
end

This is not the only source of this error, because of :controller parameter is used in relative form, so any usage of ActionController::Base#url_for would throw an error (e.g. during menu generation).

The only way for a while to bypass the error is to avoid namespaces in plugins.

To produce an error you need to generate a plugin with controller using namespaces, like Reports::BadPluginController < ApplicationController, which action renders as redmine part (using standard redmine layout), and route to it get 'projects/:project_id/reports/bad_plugin'.

Met at

Environment:
  Redmine version                3.2.0.stable
  Ruby version                   2.1.5-p273 (2014-11-13) [i386-mingw32]
  Rails version                  4.2.5.1
  Environment                    development
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.5
  Filesystem


Related issues

Is duplicate of Redmine - Defect #15872: url_for causes routing problems if a plugin uses namespacesNew

Actions
Actions

Also available in: Atom PDF