Bugzilla – Attachment 110631 Details for
Bug 26438
Follow up to bug 23463 - return from Koha::Item overwrites existing variable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26438: Rename temporary Koha::Item variables to avoid conflict
Bug-26438-Rename-temporary-KohaItem-variables-to-a.patch (text/plain), 2.71 KB, created by
Katrin Fischer
on 2020-09-23 21:03:02 UTC
(
hide
)
Description:
Bug 26438: Rename temporary Koha::Item variables to avoid conflict
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-09-23 21:03:02 UTC
Size:
2.71 KB
patch
obsolete
>From ba1e169e4a3207aa92c144c5499ea5d3cfff82d4 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >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 <kyle@bywatersolutions.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > 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.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26438
:
109966
|
110590
| 110631