From 2edd08b4d820a9cbecb548c7e238b1322acbca9e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 23 Mar 2020 10:31:39 +0000 Subject: [PATCH] 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 --- Koha/Illrequest.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index cd5a593151..bc39152d58 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -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; } -- 2.39.5