Bug 23432

Summary: Stock rotation: cancelled transfer result in stockrotation failures
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Staff ClientAssignee: Martin Renvoize <martin.renvoize>
Status: RESOLVED FIXED QA Contact: Nick Clemens <nick>
Severity: major    
Priority: P5 - low CC: aleisha, bugzilla, gmcharlt, katrin.fischer, lucas, martin.renvoize, nick, testopia
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06
Bug Depends on: 11897, 24296    
Bug Blocks:    
Attachments: Bug 23432: Replace 'die' with 'warn'
Bug 23432: Replace 'die' with 'warn'
Bug 23432: Replace 'die' with 'warn'
Bug 23432: (QA follow-up) Add a unit test

Description Martin Renvoize 2019-08-05 16:12:22 UTC
If one cancels a transfer that has been initiated via StockRotation, then the next call to the stockrotation cronjob will fail due to a 'die' line when said transfer can no longer be found.
Comment 1 Martin Renvoize 2020-09-23 11:29:53 UTC
Created attachment 110591 [details] [review]
Bug 23432: Replace 'die' with 'warn'

This patch simply replaced the die statement with a warn such that the
cron script may continue to rotate other items even if this item cannot
be properly rotated due to corrupt data.
Comment 2 Martin Renvoize 2020-09-23 11:31:32 UTC
The patch here simply replaces the die with a warn. It does not attempt to fix the original cause of the data corruption that can take place... we attempt to resolve that in the transfers re-write tree where we significantly clean up how the transfers processes all interact.
Comment 3 Chris Cormack 2020-10-24 21:34:56 UTC
Created attachment 112405 [details] [review]
Bug 23432: Replace 'die' with 'warn'

This patch simply replaced the die statement with a warn such that the
cron script may continue to rotate other items even if this item cannot
be properly rotated due to corrupt data.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 4 Nick Clemens 2020-10-24 23:54:43 UTC
Created attachment 112424 [details] [review]
Bug 23432: Replace 'die' with 'warn'

This patch simply replaced the die statement with a warn such that the
cron script may continue to rotate other items even if this item cannot
be properly rotated due to corrupt data.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens 2020-10-24 23:54:49 UTC
Created attachment 112425 [details] [review]
Bug 23432: (QA follow-up) Add a unit test

prove -v t/db_dependent/StockRotationItems.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2020-10-25 23:05:53 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass 2020-11-13 18:34:47 UTC
backported to 20.05.x for 20.05.06
Comment 8 Aleisha Amohia 2020-11-17 04:23:01 UTC
missing dependencies, not backported to 19.11.x