Bugzilla – Attachment 101502 Details for
Bug 24672
Error on receiving orders when there is an order with a deleted record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24672: (bug 24430 follow-up) Do not get active orders on deleted biblio record
Bug-24672-bug-24430-follow-up-Do-not-get-active-or.patch (text/plain), 1.56 KB, created by
Tomás Cohen Arazi
on 2020-03-24 05:02:20 UTC
(
hide
)
Description:
Bug 24672: (bug 24430 follow-up) Do not get active orders on deleted biblio record
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2020-03-24 05:02:20 UTC
Size:
1.56 KB
patch
obsolete
>From 7adc9265ee6056be6dc5e33573f08b392676dba2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Feb 2020 14:58:02 +0100 >Subject: [PATCH] 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> >--- > acqui/parcel.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 3fcc211b20..8d094d8ffe 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -241,7 +241,7 @@ unless( defined $invoice->{closedate} ) { > > my $biblionumber = $line{'biblionumber'}; > my $biblio = Koha::Biblios->find( $biblionumber ); >- my $countbiblio = $biblio->active_orders->count; >+ my $countbiblio = $biblio ? $biblio->active_orders->count : 0; > my $ordernumber = $line{'ordernumber'}; > my $order_object = Koha::Acquisition::Orders->find($ordernumber); > my $cnt_subscriptions = $biblio ? $biblio->subscriptions->count: 0; >-- >2.26.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24672
:
99090
| 101502