Bug 7061 - SQLHelper has unused global variables
Summary: SQLHelper has unused global variables
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: 3.6
Hardware: All All
: PATCH-Sent (DO NOT USE) trivial
Assignee: Ian Walls
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 00:16 UTC by Ian Walls
Modified: 2013-12-05 19:59 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Proposed Patch (1.06 KB, patch)
2011-10-19 00:21 UTC, Ian Walls
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 7061: unnecessary global variables declared in C4::SQLHelper (1.13 KB, patch)
2011-10-19 19:56 UTC, Nicole C. Engard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.