Bugzilla – Attachment 4467 Details for
Bug 6503
Variable $sth is declared 3 times (with keyword "my") in "makepayment" sub of "Accounts.pm"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6503 - Variable $sth is declared 3 times (with keyword "my") in "makepayment" sub of "Accounts.pm"
Bug-6503---Variable-sth-is-declared-3-times-with-k.patch (text/plain), 2.11 KB, created by
Chris Cormack
on 2011-06-14 22:44:28 UTC
(
hide
)
Description:
Bug 6503 - Variable $sth is declared 3 times (with keyword "my") in "makepayment" sub of "Accounts.pm"
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-06-14 22:44:28 UTC
Size:
2.11 KB
patch
obsolete
>From 72311e1d103a49b02c436797fccf06b06fd1c52b Mon Sep 17 00:00:00 2001 >From: Ricardo Dias Marques <koha@ricmarques.net> >Date: Tue, 14 Jun 2011 18:24:29 +0100 >Subject: [PATCH] Bug 6503 - Variable $sth is declared 3 times (with keyword "my") in "makepayment" sub of "Accounts.pm" > >In the code available today (14-Jun-2011), in Koha git's "master" branch, >the file "Accounts.pm" (in the "C4" directory) has the variable "$sth" >declared 3 times in the "makepayment" sub. This causes the following >warnings to appear when running "make test" in Koha installation, for >several tests: >t/Heading.t ......................... "my" variable $sth masks earlier declaration >in same scope at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 172. >"my" variable $sth masks earlier declaration in same scope at >kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 188. >[...] >t/ILSDI_Services.t .................. "my" variable $sth masks earlier declaration >in same scope at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 172. >"my" variable $sth masks earlier declaration in same scope >at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 188. >[...etc...] > >Therefore, I'm removing the "my" keyword from the declarations of "$sth" >in lines 172 and 188 of "Accounts.pm". > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/Accounts.pm | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 7bddd1a..3275099 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -169,7 +169,7 @@ sub makepayment { > my $data = $sth->fetchrow_hashref; > $sth->finish; > >- my $sth = $dbh->prepare("UPDATE accountlines >+ $sth = $dbh->prepare("UPDATE accountlines > SET amountoutstanding = 0 > WHERE borrowernumber = ? > AND accountno = ?"); >@@ -185,7 +185,7 @@ sub makepayment { > > # create new line > my $payment = 0 - $amount; >- my $sth = $dbh->prepare("INSERT INTO accountlines >+ $sth = $dbh->prepare("INSERT INTO accountlines > (borrowernumber, accountno, date, amount, > description, accounttype, amountoutstanding) > VALUES (?,?,now(),?,?,'Pay',0)"); >-- >1.7.4.1
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 6503
:
4453
| 4467