Bug 23463: (RM follow-up) Add try block around Illrequest item creation

The recently introduced Ill item creation for circulation feature was
not properly handling the move from AddItem to Koha::Item->new()->store.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2020-03-23 10:31:39 +00:00
parent e6d255b5e5
commit 2edd08b4d8
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 4 additions and 2 deletions

View File

@ -1172,8 +1172,10 @@ sub check_out {
itype => $params->{item_type},
barcode => 'ILL-' . $self->illrequest_id
};
my $item = Koha::Item->new($item_hash);
$itemnumber = $item->itemnumber;
try {
my $item = Koha::Item->new($item_hash)->store;
$itemnumber = $item->itemnumber;
};
} else {
$itemnumber = $items[0]->itemnumber;
}