From 53bb1ae005c09e671faab7e21b714d2d8482e94a Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 1 Mar 2024 09:39:35 +0000 Subject: [PATCH] Bug 36212: Add check on barcode before searching items Content-Type: text/plain; charset=utf-8 Test plan: Add an item to your database that has no barcode. Run t/db_dependent/Circulation.t It will fail without this patch, pass with this patch. Signed-off-by: Marcel de Rooy --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 109809d4b9..0627b052f7 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -327,7 +327,7 @@ sub transferbook { my $trigger = $params->{trigger}; my $messages; my $dotransfer = 1; - my $item = Koha::Items->find( { barcode => $barcode } ); + my $item = $barcode ? Koha::Items->find( { barcode => $barcode } ) : undef; Koha::Exceptions::MissingParameter->throw( "Missing mandatory parameter: from_branch") -- 2.30.2