Skip to content

Latest version doesn't save multiple rows in timesheet (wktime module) #145

@aleroot

Description

@aleroot

When trying to save more than one row in the wktime module just one row is saved, and if you try to insert more than one row you get a 500 error due to a null pointer exception.

The stacktrace is :

Completed 500 Internal Server Error in 333ms (ActiveRecord: 147.4ms)

NoMethodError (undefined method `each_with_index' for nil:NilClass):
  plugins/redmine_wktime/app/controllers/wktime_controller.rb:1193:in `block in gatherEntries'
  plugins/redmine_wktime/app/controllers/wktime_controller.rb:1177:in `each'
  plugins/redmine_wktime/app/controllers/wktime_controller.rb:1177:in `each_with_index'
  plugins/redmine_wktime/app/controllers/wktime_controller.rb:1177:in `gatherEntries'
  plugins/redmine_wktime/app/controllers/wktime_controller.rb:172:in `update'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

The problem seems to be caused by a negative index in the row index variable.

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