From: Jonathan Druart Date: Mon, 16 Mar 2020 12:49:01 +0000 (+0100) Subject: Bug 23463: Replace new occurrence of AddItem X-Git-Tag: v20.05.00~1027 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=8170645f84be2b1f4c8e527258e58117ae2e0593;hp=34cca6a775abed84c2978b9ebd38bac56ae6a82a;p=srvgit Bug 23463: Replace new occurrence of AddItem Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index a11ff8601f..cd5a593151 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -39,7 +39,6 @@ use Koha::Biblios; use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; -use C4::Items qw( AddItem ); use C4::Circulation qw( CanBookBeIssued AddIssue ); use base qw(Koha::Object); @@ -1166,15 +1165,15 @@ sub check_out { my $itemnumber; if ($item_count == 0) { my $item_hash = { + biblionumber => $self->biblio_id, homebranch => $params->{branchcode}, holdingbranch => $params->{branchcode}, location => $params->{branchcode}, itype => $params->{item_type}, barcode => 'ILL-' . $self->illrequest_id }; - my (undef, undef, $item_no) = - AddItem($item_hash, $self->biblio_id); - $itemnumber = $item_no; + my $item = Koha::Item->new($item_hash); + $itemnumber = $item->itemnumber; } else { $itemnumber = $items[0]->itemnumber; }