Skip to content

Internal error when "date used as today" is empty or after the last date shown #31

@macco3k

Description

@macco3k

When the "date used as today" is after the last date shown, an internal error is shown and the log has this message:

Started GET "/redmine/work_load/show?utf8=%E2%9C%93&workload%5Bfirst_day%5D=2015-10-01&workload%5Blast_day%5D=2015-11-23&workload%5Bstart_date%5D=2015-12-01&workload%5Busers%5D%5B%5D=4" for 127.0.0.1 at 2015-11-03 10:55:34 +0100
  Processing by WorkLoadController#show as HTML
  Parameters: {"utf8"=>"✓", "workload"=>{"first_day"=>"2015-10-01", "last_day"=>"2015-11-23", "start_date"=>"2015-12-01", "users"=>["4"]}}
Current user: Danielem (id=4)
Completed 500 Internal Server Error in 47ms (ActiveRecord: 15.6ms)

NoMethodError (undefined method `[]' for nil:NilClass):
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

This also occurs when it's empty, but the error is slightly different, showing a

ArgumentError (comparison of Date with nil failed):
 lib/redmine/sudo_mode.rb:63:in `sudo_mode'

instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions