Bugzilla – Attachment 144468 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.53 KB, created by
Marcel de Rooy
on 2022-12-07 13:55:58 UTC
(
hide
)
Description:
Bug 32417: Allow NULL in biblionumber in $order->store
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-12-07 13:55:58 UTC
Size:
1.53 KB
patch
obsolete
>From ee6a69ce053f2e2135df8d4d0d41e8e3fe1abb05 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 >Content-Type: text/plain; charset=utf-8 > >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> >--- > Koha/Acquisition/Order.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index d9161a3e9b..f6308d13e1 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; > } >@@ -158,6 +159,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