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>
This commit is contained in:
Marcel de Rooy 2024-03-01 09:39:35 +00:00 committed by Katrin Fischer
parent 2e6a2c3b5b
commit 8413b37679
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

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