Bug 7061

Summary: SQLHelper has unused global variables
Product: Koha Reporter: Ian Walls <koha.sekjal>
Component: Architecture, internals, and plumbingAssignee: Ian Walls <koha.sekjal>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: trivial    
Priority: PATCH-Sent (DO NOT USE) CC: henridamien.laurent, nengard, paul.poulain
Version: 3.6   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed Patch
[SIGNED-OFF] Bug 7061: unnecessary global variables declared in C4::SQLHelper

Description Ian Walls 2011-10-19 00:16:44 UTC
my $tablename and my $hash are globally defined in C4::SQLHelper, but are never used; all subroutines use a locally scoped $tablename, and $hash is never used, locally or otherwise.

Removing these two lines may help ensure mod_perl compatibility (since variables in subroutines cannot safely alter values in outer script in persistent environments).  Or not.  If nothing else, it's just a bit a trivial cleanup.
Comment 1 Ian Walls 2011-10-19 00:21:49 UTC Comment hidden (obsolete)
Comment 2 laurenthdl 2011-10-19 15:06:50 UTC
idea was to use the hash to store the whole database structure and use that rather than making a SHOW TABLE never been implemented because of time.
It should help to store the database structure somewhere in some way.
Would it be DBIC schema, or a yaml file no preference. But should be in our mind though
Comment 3 Nicole C. Engard 2011-10-19 19:56:14 UTC
Created attachment 5997 [details] [review]
[SIGNED-OFF] Bug 7061: unnecessary global variables declared in C4::SQLHelper

Removes $tablename and $hash from global scope of C4/SQLHelper.pm.  They are never used;
all instances of $table are locally scoped to the subroutines, and $hash is never used.

This may help with persistance; if not, it's at least a bit of trivial cleanup.

To test:

1.  Search for a patron
2.  Create a Contract in Acquisitions
3.  Modify that Contract
4.  Delete that Contract

All instances should return error free.  This checks the subroutines of SQLHelper

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Comment 4 Ian Walls 2011-10-19 22:18:38 UTC
Marking Passed QA, RM please verify.
Comment 5 Paul Poulain 2011-11-04 11:20:04 UTC
patch pushed, trivial changes & perfect test plan, please test & close
Comment 6 Jared Camins-Esakov 2012-05-23 12:44:54 UTC
This was included in the 3.6 branch prior to 3.6.4.