From dc94e57b9620116a889b39eef700ace2f42b8664 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 (cherry picked from commit 647e05d8265831a09f6c624928990cfd62896b39) Signed-off-by: Lucas Gass --- Koha/EDI.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 3b89d4e5f4..07e988c20f 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -720,8 +720,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( { @@ -812,8 +812,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( { @@ -882,8 +882,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