Bugzilla – Attachment 144518 Details for
Bug 32417
Cannot insert order: Mandatory parameter biblionumber is missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32417: Allow NULL in biblionumber in $order->store
Bug-32417-Allow-NULL-in-biblionumber-in-order-stor.patch (text/plain), 1.93 KB, created by
David Nind
on 2022-12-09 08:30:55 UTC
(
hide
)
Description:
Bug 32417: Allow NULL in biblionumber in $order->store
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-12-09 08:30:55 UTC
Size:
1.93 KB
patch
obsolete
>From f7cd6094e3514fadbc3214528ae0b0e8fcc9ab48 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 7 Dec 2022 13:27:02 +0000 >Subject: [PATCH] Bug 32417: Allow NULL in biblionumber in $order->store > >If we are cancelling an order and call DelBiblio, we should >clear the biblionumber but not be crashing on it in ->store. > >The absence of the clear prevented the crash. One bug sometimes >solves another one. > >Test plan: >Create basket, order line. >Delete order with biblio record. >Verify result and logfile. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Acquisition/Order.pm | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index d9161a3e9b..b9059b0132 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -77,6 +77,7 @@ sub store { > > # if these parameters are missing, we can't continue > for my $key (qw( basketno quantity biblionumber budget_id )) { >+ next if $key eq 'biblionumber' && ($self->orderstatus // q{}) eq 'cancelled'; # cancelled order might have biblionumber NULL > croak "Cannot insert order: Mandatory parameter $key is missing" > unless $self->$key; > } >@@ -105,8 +106,11 @@ sub store { > =head3 cancel > > $order->cancel( >- { [ reason => $reason, >- delete_biblio => $delete_biblio ] >+ { >+ [ >+ reason => $reason, >+ delete_biblio => $delete_biblio >+ ] > } > ); > >@@ -158,6 +162,7 @@ sub cancel { > payload => { biblio => $biblio, reason => $error } > } > ) if $error; >+ $self->biblionumber(undef) unless $error; # constraint cleared biblionumber in db already > } > else { > >-- >2.30.2
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 32417
:
144467
|
144468
|
144514
|
144515
|
144517
| 144518