ande3577 / redmine-graphs-plugin

This plugin provides instances of Redmine a method with additional graphs.
Other
5 stars 3 forks source link

Cross-plugin problems when rendering issues sidebar with GraphsController #12

Closed hdgarrood closed 11 years ago

hdgarrood commented 11 years ago

The graphs pages, which are rendered by GraphsController, also render the issues sidebar.

Unfortunately, this means that any plugin which hooks into the issues sidebar and uses its own helper methods might break all the graphs views.

For example, some plugins have their own helper modules, which then are used by IssuesController by doing IssuesController.send(:helper, OtherPlugin::FooHelper)

There's an example of this at ixti/redmine_tags#45.

I can think of two ways to fix this:

Personally I prefer the second, as there doesn't seem to be any way of doing the first which isn't a horrendous hack (see the patch on the redmine_tags issue for the horrendous hack approach).

Thoughts?

ande3577 commented 11 years ago

I took a look at this and was able to confirm this issue. I'm running into problems with both the solutions you suggested. I will continue working in it and hopefully come up with a solution. Thank you for the report.

hdgarrood commented 11 years ago

@ande3577 thanks :) You might also want to have a look at https://github.com/apotonick/cells

cforce commented 11 years ago

Please fix soon.

ande3577 commented 11 years ago

Should be working now, not the best implementation, but should at least prevent 500 errors.

dkmorgan commented 11 years ago

I still get a 500 error with this fix. Now the error occurs with a fresh Redmine 2.2.3 install with no other plugins:

Started GET "/redmine-temp/projects/temp/issues/total_vs_closed" for 127.0.0.1 at Tue Apr 30 13:45:34 +0900 2013 Processing by GraphsController#total_vs_closed as HTML Parameters: {"project_id"=>"temp"} Current user: anonymous Rendered plugins/redmine_graphs/app/views/graphs/_graph_sidebar.html.erb (207.0ms) Rendered plugins/redmine_graphs/app/views/graphs/total_vs_closed.html.erb within layouts/base (219.0ms) Completed 500 Internal Server Error in 586ms

ActionView::Template::Error (undefined method _project_issues_path' for #<#<Class:0x3d3e9783>:0x584d38de>): 1: <h3><%= l(:label_issue_plural) %></h3> 2: 3: <ul> 4: <li><%= link_to l(:label_issue_view_all), _project_issues_path(@project, :set_filter => 1) %></li> 5: <% if @project %> 6: <li><%= link_to l(:field_summary), project_issues_report_path(@project) %></li> 7: <% end %> app/helpers/application_helper.rb:1192:incontent_for'

ande3577 commented 11 years ago

Confirmed.

On Mon, Apr 29, 2013 at 11:51 PM, chikigai notifications@github.com wrote:

I still get a 500 error with this fix. Now the error occurs with a fresh Redmine 2.2.3 install with no other plugins:

Started GET "/redmine-temp/projects/temp/issues/total_vs_closed" for 127.0.0.1 at Tue Apr 30 13:45:34 +0900 2013 Processing by GraphsController#total_vs_closed as HTML Parameters: {"project_id"=>"temp"} Current user: anonymous Rendered plugins/redmine_graphs/app/views/graphs/_graph_sidebar.html.erb (207.0ms) Rendered plugins/redmine_graphs/app/views/graphs/total_vs_closed.html.erb within layouts/base (219.0ms) Completed 500 Internal Server Error in 586ms

ActionView::Template::Error (undefined method _project_issues_path' for

<#Class:0x3d3e9783:0x584d38de>):

1:

<%= l(:label_issue_plural) %>

2: 3:
    4:
  • <%= link_to l(:label_issue_view_all), _project_issues_path(@project, :set_filter => 1) %>
  • 5: <% if @project %> 6:
  • <%= link_to l(:field_summary), project_issues_report_path(@project) %>
  • 7: <% end %> app/helpers/application_helper.rb:1192:incontent_for'

    — Reply to this email directly or view it on GitHubhttps://github.com/ande3577/redmine-graphs-plugin/issues/12#issuecomment-17209479 .

David Anderson

dkmorgan commented 11 years ago

I can confirm the fix.