Restream / redmine_custom_reports

Redmine plugin for reports and charts
55 stars 37 forks source link

Getting internal server error "ActionView::Template::Error (undefined local variable or method `superclass' for #<QueryExt:0x3d1f4a8>)" #22

Closed soerennb closed 8 years ago

soerennb commented 9 years ago

I'm using this plugin with Redmine 3.0.0 and Rails 4.2.0, but on one report I'm getting the following error (it is working on Redmine 2.6.1 with Rails 3.2.21):

Rendered plugins/redmine_custom_reports/app/views/custom_reports/show.html.erb within layouts/base (46.9ms)
Completed 500 Internal Server Error in 125ms

ActionView::Template::Error (undefined local variable or method `superclass' for #<QueryExt:0x3d1f4a8>):
    43:     <% @custom_report.series.each do |series| %>
    44:       <%= content_tag :div, :class => "custom-report-chart",
    45:                      :style => width_style_for_series(@custom_report),
    46:                       "data-chart_data" => [series.data].to_json do %>
    47:         <h4><%= series.name %></h4>
    48:         <svg/>
    49:       <% end %>
  app/models/query.rb:594:in `statement'
  app/models/issue_query.rb:306:in `issue_count_by_group'

What could be the problem?

cubNg commented 9 years ago

Hi, I hope this could help: http://stackoverflow.com/questions/26870232/ruby-directly-send-superclass-a-message

alias_method :super_model_name, :model_name
def model_name
    super_model_name
end

in file: query_ext.rb at: Bitnami\redmine\apps\redmine\htdocs\plugins\redmine_custom_reports\app\models\

nodecarter commented 8 years ago

I think the problem was in empty series name. I've added check that series name is present.