two-pack/redmine_xlsx_format_issue_exporter

Internal error if user have no access to issues

Closed this issue · 1 comments

At first, thank you very much for your plugin!

We get Internal Server Error 500 in some circumstances.

Steps to reproduce:

  • Create redmine user with access to project but without access to issue list
  • Logon with that user to redmine
  • Go to issue list link (from e-mail, or by plain input to browser for example): example.com/projects/project1/issues

Expected behaviour:

  • Get standard redmine access denied message

Actual behaviour:

  • Intrnal server error 500

Part from logs about that:

ActionView::Template::Error (undefined method `filters' for nil:NilClass):
    4:   <h3 class="title"><%= l(:label_export_options, :export_format => 'XLSX') %></h3>
    5:   <%= form_tag(_project_issues_path(@project, :format => 'xlsx'), :method => :get, :id => 'xlsx-export-form') do %>
    6:       <% if respond_to?(:query_as_hidden_field_tags) %>
    7:         <%= query_as_hidden_field_tags(@query) %>
    8:       <% end %>
    9:       <% if not @sort_criteria.nil? %>
   10:         <%= hidden_field_tag 'sort', @sort_criteria.to_param, :id => nil %>
  app/helpers/queries_helper.rb:342:in `query_as_hidden_field_tags'
  plugins/redmine_xlsx_format_issue_exporter/app/views/hooks/_xlsx_export_dialog_on_issues_index.erb:7:in `block in _plugins_redmine_xlsx_format_issue_exporter_app_views_hooks__xlsx_export_dialog_on_issues_index_erb___4206568778136958682_69874420477360'
  plugins/redmine_xlsx_format_issue_exporter/app/views/hooks/_xlsx_export_dialog_on_issues_index.erb:5:in `_plugins_redmine_xlsx_format_issue_exporter_app_views_hooks__xlsx_export_dialog_on_issues_index_erb___4206568778136958682_69874420477360'
  plugins/redmine_xlsx_format_issue_exporter/lib/redmine_xlsx_format_issue_exporter/view_layouts_base_body_bottom_hook.rb:16:in `view_layouts_base_body_bottom'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/layouts/base.html.erb:124:in `_app_views_layouts_base_html_erb__1418560166322282337_69874466231980'
  app/controllers/application_controller.rb:491:in `block (2 levels) in render_error'
  app/controllers/application_controller.rb:489:in `render_error'
  app/controllers/application_controller.rb:472:in `render_403'
  app/controllers/application_controller.rb:252:in `deny_access'
  app/controllers/application_controller.rb:293:in `find_optional_project'

Fixed this problem.
Thanks for reporting :)