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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8413b37679)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Marcel de Rooy 2024-03-01 09:39:35 +00:00 committed by Fridolin Somers
parent b0660d11f5
commit 246566b7d1

View file

@ -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")