Bug 20303

Summary: Receive order fails if no "authorised_by" value
Product: Koha Reporter: Barry Cannon <bc>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: major    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, josef.moravec, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17829    
Bug Blocks:    
Attachments: Bug 20303: Do not explode when receiving an order if authorisedby not set
Bug 20303: Do not explode when receiving an order if authorisedby not set
Bug 20303: Do not explode when receiving an order if authorisedby not set

Description Barry Cannon 2018-02-27 13:03:46 UTC
If there is no "authorised by" value on the order the "receive" option fails with 500 error. The file called is orderreceive.pl?ordernumber=1234&invoiceid=1234

orderreceive.pl should check if authorised_by exists before looking up patron information.
Comment 1 Jonathan Druart 2018-02-27 18:50:43 UTC
I guess this is caused by bug 17829.
Comment 2 Jonathan Druart 2018-02-27 18:55:00 UTC
Created attachment 72281 [details] [review]
Bug 20303: Do not explode when receiving an order if authorisedby not set
Comment 3 Jonathan Druart 2018-02-27 18:56:17 UTC
Barry, do you have more info about how it happens?

I guess it can happen on a very old DB (before aqbaskets.authorisedby) or if the librarian record has been deleted.
Comment 4 Barry Cannon 2018-02-28 13:01:28 UTC
Yes, this manifested itself after an upgrade from an older version so it could be that this might not be possible if starting acquisitions from current.
Comment 5 Mark Tompsett 2018-03-07 20:36:34 UTC
Created attachment 72522 [details] [review]
Bug 20303: Do not explode when receiving an order if authorisedby not set

Reproduced by deleting user and patron to notify before clicking Receive.
Patch works.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 6 Josef Moravec 2018-03-08 12:55:25 UTC
Created attachment 72536 [details] [review]
Bug 20303: Do not explode when receiving an order if authorisedby not set

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Nick Clemens 2018-03-15 09:21:11 UTC
Pushed to master for 18.05, thanks to all for your hard work.
Comment 8 Nick Clemens 2018-03-23 12:51:56 UTC
Awesome work all! Pushed to stable for 17.11.04
Comment 9 Fridolin Somers 2018-03-27 11:44:34 UTC
Not in 17.05.x since Bug 17829 not in it