Bug 19596

Summary: Internal server error if open order with deleted biblio / null biblionumber
Product: Koha Reporter: Nick Clemens <nick>
Component: AcquisitionsAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: aleisha, fridolin.somers, jonathan.druart, jschmidt, m.de.rooy, mtj
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17631, 18256    
Bug Blocks:    
Attachments: Bug 19596 - Don't try to get hold or items count for non-existent biblios
Bug 19596 - Don't try to get hold or items count for non-existent biblios
Bug 19596 - Don't try to get hold or items count for non-existent biblios
Bug 19596 - Don't try to get hold or items count for non-existent biblios

Description Nick Clemens 2017-11-08 17:53:39 UTC

    
Comment 1 Nick Clemens 2017-11-08 17:56:58 UTC
Created attachment 69043 [details] [review]
Bug 19596 - Don't try to get hold or items count for non-existent biblios

To test:
1 - Create some orders
2 - Delete the bibs (or NULL biblionumber from DB)
3 - Try to recieve some orders
4 - Internal server error
5 - Apply patch
6 - Things should work
Comment 2 Jonathan Druart 2017-11-08 18:26:30 UTC
Reading the changes, there is this line 2 lines before:
    my $cnt_subscriptions = $biblio->subscriptions->count;
I guess it will explode as well
Comment 3 Nick Clemens 2017-11-08 21:42:22 UTC
Created attachment 69047 [details] [review]
Bug 19596 - Don't try to get hold or items count for non-existent biblios

To test:
1 - Create some orders
2 - Delete the bibs (or NULL biblionumber from DB)
3 - Try to recieve some orders
4 - Internal server error
5 - Apply patch
6 - Things should work


Current status: Needs Signoff
Comment 4 Nick Clemens 2017-11-08 21:43:07 UTC
(In reply to Jonathan Druart from comment #2)
> Reading the changes, there is this line 2 lines before:
>     my $cnt_subscriptions = $biblio->subscriptions->count;
> I guess it will explode as well

Good call, I was debugging from 17.05 - the first patch without the added line will be needed there.
Comment 5 Dilan Johnpullé 2017-11-21 05:07:52 UTC
Created attachment 69242 [details] [review]
Bug 19596 - Don't try to get hold or items count for non-existent biblios

Patch applies and works as expected.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Comment 6 Marcel de Rooy 2017-11-24 08:11:18 UTC
Created attachment 69328 [details] [review]
Bug 19596 - Don't try to get hold or items count for non-existent biblios

Patch applies and works as expected.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Jonathan Druart 2017-11-26 16:26:39 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Jonathan Druart 2017-12-21 13:29:13 UTC
*** Bug 19293 has been marked as a duplicate of this bug. ***
Comment 9 Mason James 2018-01-31 02:40:11 UTC
(In reply to Jonathan Druart from comment #7)
> Pushed to master for 17.11, thanks to everybody involved!

Fridolin, can we get this backported to 17.05.x please :)
Comment 10 Mason James 2018-01-31 02:52:18 UTC
(In reply to Mason James from comment #9)
> (In reply to Jonathan Druart from comment #7)
> > Pushed to master for 17.11, thanks to everybody involved!
> 
> Fridolin, can we get this backported to 17.05.x please :)

fyi: it seems this patch can be skipped for 16.11.x
Comment 11 Fridolin Somers 2018-02-05 10:34:49 UTC
(In reply to Mason James from comment #10)
> (In reply to Mason James from comment #9)
> > (In reply to Jonathan Druart from comment #7)
> > > Pushed to master for 17.11, thanks to everybody involved!
> > 
> > Fridolin, can we get this backported to 17.05.x please :)
> 
> fyi: it seems this patch can be skipped for 16.11.x

Thanks for pointing this.
Pushed to 17.05.x for v17.05.09