]> git.koha-community.org Git - koha.git/commit
Bug 24672: (bug 24430 follow-up) Do not get active orders on deleted biblio record
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 17 Feb 2020 13:58:02 +0000 (14:58 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 09:31:34 +0000 (09:31 +0000)
commitc8718bd4af3e5b1329878cee6ff27a7a5a27091b
treeea544e41c28f001d8cc6afc1ad9de65146cb47c2
parent7d66e67bd1e8e4f3b47b3a75e01a286191205637
Bug 24672: (bug 24430 follow-up) Do not get active orders on deleted biblio record

On bug 24430 we replaced the call to CountBiblioInOrders with
Koha::Biblio->active_orders
In case the bibliographic record is deleted, the count must be set to 0.

This prevent the app to crash with:
Can't call method "active_orders" on an undefined value at
/home/vagrant/kohaclone/acqui/parcel.pl line 244

Test plan:
Create 2+ orders
Receive one, delete it, delete the bibliographic record
Receive the order one
=> Without this patch, on the parcel page you should get the error
=> With this patch applied you must be allowed to finish the receive

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
acqui/parcel.pl