From 246566b7d1bc275e946860e950692216fbafc871 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 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 Signed-off-by: Katrin Fischer (cherry picked from commit 8413b376798097725cfd2ca3eb7a12427ad08163) Signed-off-by: Fridolin Somers --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 651fdb497b..b98c4098a9 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.39.5