From 647e05d8265831a09f6c624928990cfd62896b39 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Fri, 11 Sep 2020 18:16:28 +0100 Subject: [PATCH] Bug 26438: Rename temporary Koha::Item variables to avoid conflict Returns from Koha::Item calls were stored in temporary variables called $item. Unfortunately they occur in routines already with an $item variable holding a lineitem and hide that variable although only required for two lines of code. An error occurs if girfield is called on the wrong variable. Renamed all three occurences of $item to $kitem to avoid the error Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- Koha/EDI.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index ad2691e936..8fc8d0d828 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -738,8 +738,8 @@ sub quote_item { while ( $created < $order_quantity ) { $item_hash->{biblionumber} = $bib->{biblionumber}; $item_hash->{biblioitemnumber} = $bib->{biblioitemnumber}; - my $item = Koha::Item->new( $item_hash )->store; - my $itemnumber = $item->itemnumber; + my $kitem = Koha::Item->new( $item_hash )->store; + my $itemnumber = $kitem->itemnumber; $logger->trace("Added item:$itemnumber"); $schema->resultset('AqordersItem')->create( { @@ -830,8 +830,8 @@ sub quote_item { $item_hash->{biblionumber} = $bib->{biblionumber}; $item_hash->{biblioitemnumber} = $bib->{biblioitemnumber}; - my $item = Koha::Item->new( $item_hash )->store; - my $itemnumber = $item->itemnumber; + my $kitem = Koha::Item->new( $item_hash )->store; + my $itemnumber = $kitem->itemnumber; $logger->trace("New item $itemnumber added"); $schema->resultset('AqordersItem')->create( { @@ -900,8 +900,8 @@ sub quote_item { }; $new_item->{biblionumber} = $bib->{biblionumber}; $new_item->{biblioitemnumber} = $bib->{biblioitemnumber}; - my $item = Koha::Item->new( $new_item )->store; - my $itemnumber = $item->itemnumber; + my $kitem = Koha::Item->new( $new_item )->store; + my $itemnumber = $kitem->itemnumber; $logger->trace("New item $itemnumber added"); $schema->resultset('AqordersItem')->create( { -- 2.39.5