Bug 12198 - Guarantor search makes incorrect and unnecessary call to GetMemberIssuesAndFines
Summary: Guarantor search makes incorrect and unnecessary call to GetMemberIssuesAndFines
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-06 16:26 UTC by Kyle M Hall
Modified: 2014-12-07 20:07 UTC (History)
2 users (show)

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


Attachments
Bug 12198 - Guarantor search makes incorrect and unnecessary call to GetMemberIssuesAndFines (1.52 KB, patch)
2014-05-06 16:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12198 - Remove unused variables, tidy code (5.31 KB, patch)
2014-05-06 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12198: remove unnecessary call to GetMemberIssuesAndFines from guarantor search (1.55 KB, patch)
2014-05-06 20:10 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 12198: (code cleanup) remove unused variables, tidy code (5.46 KB, patch)
2014-05-06 20:10 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 12198: (follow-up) fix warning when opening guarantor search form (1.05 KB, patch)
2014-05-06 20:10 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 12198: remove unnecessary call to GetMemberIssuesAndFines from guarantor search (1.61 KB, patch)
2014-05-08 15:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12198: (code cleanup) remove unused variables, tidy code (5.52 KB, patch)
2014-05-08 15:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12198: (follow-up) fix warning when opening guarantor search form (1.11 KB, patch)
2014-05-08 15:45 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2014-05-06 16:26:36 UTC
The script members/guarantor_search.pl makes the following call:
my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowerid'});

Not only does this call always fail because borrowerid is not a valid key, but the results are never even used in the template!
Comment 1 Kyle M Hall 2014-05-06 16:28:13 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-05-06 16:37:32 UTC Comment hidden (obsolete)
Comment 3 Galen Charlton 2014-05-06 20:10:22 UTC Comment hidden (obsolete)
Comment 4 Galen Charlton 2014-05-06 20:10:26 UTC Comment hidden (obsolete)
Comment 5 Galen Charlton 2014-05-06 20:10:29 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2014-05-08 15:45:32 UTC
Created attachment 28108 [details] [review]
Bug 12198: remove unnecessary call to GetMemberIssuesAndFines from guarantor search

The script members/guarantor_search.pl made the following call:
my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowerid'});

Not only does this call always fail because borrowerid is not a valid
key, but the results are never even used in the template!

Test Plan:
1) Apply this patch
2) Verify the gurantor search works as before,
   No changes in behavior should be noted

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Jonathan Druart 2014-05-08 15:45:38 UTC
Created attachment 28109 [details] [review]
Bug 12198: (code cleanup) remove unused variables, tidy code

To test:

[1] Perform searches for guarantors and verify that there
    are no regressions.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Jonathan Druart 2014-05-08 15:45:50 UTC
Created attachment 28110 [details] [review]
Bug 12198: (follow-up) fix warning when opening guarantor search form

To test:

[1] Verify that act of running a guarantor search does not result in
    the following warning message in the Apache log:

"guarantor_search.pl: Use of uninitialized value $member in string ne
 at guarantor_search.pl line 63"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 9 Galen Charlton 2014-05-08 16:42:20 UTC
Pushed to master.  Thanks, Kyle!