We have seen reports of sites where checkins appear to be failing due to corrupt data with the error: The checkin for the following issue failed, Please go to the about page, section 'data corrupted' to know how to fix this problem (DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x55c471ef6c28): row not found at /usr/share/koha/lib/Koha/Object.pm line 158 This seems to be caused by a double submission / race condition - the checkout is returned twice - the first succeeeds, the second fails because the row is moved to old_issues Sometimes it succeeds an is logged as a return + localuse We should prevent this from happening
Created attachment 107764 [details] [review] Bug 26136: Prevent double submit on checkin-form To test: 1 - Browse to Circulation->Check-in 2 - Type a barcode into the Check in box 3 - Hit Enter as many as times as you can 4 - Check the statistics table: SELECT * FROM statistics WHERE itemnumber={itemnumber} AND DATE(datetime)=CURDATE(); 5 - Note you have multiple lines for the same item at the same time 6 - Apply patch 7 - Reload the page 8 - Type the barcode 9 - Press Enter even more fast and more furiously 10 - Check the statistics table 11 - Only one entry, huzzah!
Created attachment 107784 [details] [review] Bug 26136: Prevent double submit on checkin-form To test: 1 - Browse to Circulation->Check-in 2 - Type a barcode into the Check in box 3 - Hit Enter as many as times as you can 4 - Check the statistics table: SELECT * FROM statistics WHERE itemnumber={itemnumber} AND DATE(datetime)=CURDATE(); 5 - Note you have multiple lines for the same item at the same time 6 - Apply patch 7 - Reload the page 8 - Type the barcode 9 - Press Enter even more fast and more furiously 10 - Check the statistics table 11 - Only one entry, huzzah! Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Created attachment 107907 [details] [review] Bug 26136: Prevent double submit on checkin-form To test: 1 - Browse to Circulation->Check-in 2 - Type a barcode into the Check in box 3 - Hit Enter as many as times as you can 4 - Check the statistics table: SELECT * FROM statistics WHERE itemnumber={itemnumber} AND DATE(datetime)=CURDATE(); 5 - Note you have multiple lines for the same item at the same time 6 - Apply patch 7 - Reload the page 8 - Type the barcode 9 - Press Enter even more fast and more furiously 10 - Check the statistics table 11 - Only one entry, huzzah! Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.03
cannot reproduce bug in 19.11.x. not backported.
managed to reproduce somewhere else, so have backported to 19.11.x for 19.11.10
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.