From 4b69178abac156110d5d92342cec045ea1e304a2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Feb 2018 15:54:38 -0300 Subject: [PATCH] Bug 20303: Do not explode when receiving an order if authorisedby not set Signed-off-by: Mark Tompsett Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens Signed-off-by: Nick Clemens --- acqui/orderreceive.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 7952e1dd8f..f6069baf34 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -186,6 +186,12 @@ my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber}); my $authorisedby = $order->{authorisedby}; my $authorised_patron = Koha::Patrons->find( $authorisedby ); +if ( $authorised_patron ) { # This should not happen unless there was a migration issue (or very old install?) + $template->param( + memberfirstname => $authorised_patron->firstname || "", + membersurname => $authorised_patron->surname || "", + ); +} my $budget = GetBudget( $order->{budget_id} ); @@ -218,8 +224,6 @@ $template->param( ecost => $ecost, unitprice => $unitprice, tax_rate => $tax_rate, - memberfirstname => $authorised_patron->firstname || "", - membersurname => $authorised_patron->surname || "", invoiceid => $invoice->{invoiceid}, invoice => $invoice->{invoicenumber}, datereceived => $datereceived, -- 2.39.5