dhanasingh / redmine_wktime

ERPmine is an open source free ERP for Service Industries. It runs within Redmine
https://erpmine.org/
Other
121 stars 79 forks source link

Server error saving Timesheet #211

Closed sherwood333 closed 4 years ago

sherwood333 commented 4 years ago

Hello,

After installing the latest update for wk_time (from 3.9.2 to 4.0.1 to 4.0.2) we noticed that saving the timesheet will throw a server side error (500)

Completed 500 Internal Server Error in 75ms (ActiveRecord: 29.2ms)

NoMethodError (undefined method `[]=' for nil:NilClass):

plugins/redmine_wktime/app/controllers/wktime_controller.rb:1433:in `block (2 levels) in gatherEntries'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:1427:in `each'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:1427:in `each_with_index'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:1427:in `block in gatherEntries'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:1411:in `each'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:1411:in `each_with_index'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:1411:in `gatherEntries'
plugins/redmine_wktime/app/controllers/wktime_controller.rb:183:in `update'

Using versions:

Wk_Time version 4.0.2 redmine version 4.1.1

amutha1997 commented 4 years ago

We are unable to reproduce this problem, is it possible for you to share your timesheet screenshot which was failing ? I mean before save.

What ruby and rails version are you using ?

sherwood333 commented 4 years ago

It looks like a save without adding a new row works as expected.

image

I've added the last row in this image. Once this row is added, the time sheet fails to save.

It seems that adding any row to this screen causes the error. I am able to add time to an existing issue in the time sheet

sherwood333 commented 4 years ago

$ruby --version ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

$ rails --version Rails 5.2.4.2

amutha1997 commented 4 years ago

This issue is fixed in 4.0.3 . 4.0.3 is released, Please take a look.

sherwood333 commented 4 years ago

Will do!

sherwood333 commented 4 years ago

Seems to be working. Thanks for your quick fix!