luciof55 / plus_gantt

Plugin for Redmine wich render a project gantt adding a control date in order to visualize the expected ratio. Also calculate automatically issue due date.
10 stars 14 forks source link

open plusgantt occur 500 error #1

Closed archonwang closed 7 years ago

archonwang commented 7 years ago

@luciof55 , open the plusgantt tag page, occur 500 error, please check it. Thanks.

errorlog is

Started GET "/projects/zmss/issues/plusgantt" for 192.168.20.231 at 2017-05-18 12:20:56 +0800
Processing by PlusganttController#show as HTML
  Parameters: {"project_id"=>"zmss"}
  Current user: hui.wang (id=8)
Read fragment views/queries/filter/user-8/2017-04-20T06:45:51Z/2017-05-16 09:48:24 UTC/e42c5980be4ccd0f7205b2df55f850cf (0.3ms)
  Rendered plugins/redmine_performance/app/views/queries/_filters.html.erb (9.3ms)
STATEMENT projects.id = 5 AND (issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=0))
  Rendered plugins/plus_gantt/app/views/plusgantt/show.html.erb within layouts/base (282.6ms)
Completed 500 Internal Server Error in 531ms (ActiveRecord: 142.0ms)

ActionView::Template::Error (comparison of Date with nil failed):
    107: 
    108:   # Width of the entire chart
    109:   g_width = ((@plusgantt.date_to - @plusgantt.date_from + 1) * zoom).to_i
    110:   @plusgantt.render(:top => headers_height + 8,
    111:                 :zoom => zoom,
    112:                 :g_width => g_width,
    113:                 :subject_width => subject_width)
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:686:in `>='
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:686:in `calc_estimated_progress'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:323:in `line_for_issue'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:263:in `render_object_row'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:251:in `block in render_issues'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:246:in `each'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:246:in `render_issues'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:229:in `block in render_project'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:282:in `increment_indent'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:218:in `render_project'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:206:in `block in render'
  app/models/project.rb:834:in `block in project_tree'
  app/models/project.rb:830:in `each'
  app/models/project.rb:830:in `project_tree'
  plugins/plus_gantt/lib/plusgantt/helpers/plusgantt.rb:204:in `render'
  plugins/plus_gantt/app/views/plusgantt/show.html.erb:110:in `_7a24b647785fe55097883ea12fa93911'
  plugins/plus_gantt/app/controllers/plusgantt_controller.rb:27:in `block (2 levels) in show'
  plugins/plus_gantt/app/controllers/plusgantt_controller.rb:26:in `show'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
luciof55 commented 7 years ago

Hi @archonwang.

I found the error. I will validate if issues have a start date, due date and estimated hours. This values are required, if some value is empty or null, then i will not calculate the expected progress.

This correction and other minor improvements will be available in the next version.

Regards.

archonwang commented 7 years ago

@luciof55 , I will check it after you have commit the next version.

Thanks.

luciof55 commented 7 years ago

@archonwang Version 0.0.3 is available. With some bugs fixes and visual interface improvements. Please check it. Regards.

smoolya17 commented 7 years ago

@luciof55 i am getting the same error and as you said the error will be resolved in version 0.0.3. And the error shown is not the expected progress error because when I applied the same settings of the plugin in another project it seems to work fine with the calculated and expected progress in place.

archonwang commented 7 years ago

@luciof55 , Thanks. It works well now.