Bug 8714 - Poorly ordered and triggers warning in marctagstructure.pl
Summary: Poorly ordered and triggers warning in marctagstructure.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low trivial
Assignee: Mark Tompsett
QA Contact: Mason James
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-03 04:21 UTC by Mark Tompsett
Modified: 2013-12-05 19:59 UTC (History)
5 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
Changed and statement to have boundary check first. (1.32 KB, patch)
2012-09-03 04:35 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 8714 - Poorly ordered and triggers warning in marctagstructure.pl (1.34 KB, patch)
2012-09-04 09:02 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 Mark Tompsett 2012-09-03 04:21:26 UTC
Found this in 3.6.3, but it applies to 3.6.x, 3.8.x, and master.
1) Log in to staff client
2) Click 'Koha administration'
3) Click 'MARC Bibliographic framework'
4) Choose a framework and click 'MARC structure'
5) Check 'Display only used Tags/Subfields'
6) Check koha error log
[Mon Sep 03 12:06:06 2012] [error] [client 192.168.100.2] [Mon Sep  3 12:06:06 2012] marctagstructure.pl: Use of uninitialized value in numeric eq (==) at /usr/share/koha/intranet/cgi-bin/admin/marctagstructure.pl line 284., referer: https://.../cgi-bin/koha/admin/marctagstructure.pl

284 is the bottom of the loop, but the top of the loop had "and boundary check" logic instead of "boundary check and" logic. Correcting this ordering problem fixed the bug.
Comment 1 Mark Tompsett 2012-09-03 04:35:11 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2012-09-04 09:02:18 UTC
Created attachment 11953 [details] [review]
Bug 8714 - Poorly ordered and triggers warning in marctagstructure.pl

An array boundary check was after a comparison using the array.
By changing the logic which had " and ( $j < $cnt)" to be at the
beginning "( $j < $cnt ) and ", the warning is no longer shown
in the error log.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 3 Mason James 2012-09-14 15:10:14 UTC
> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

patch looks good, passing QA…

$ koha-qa.pl 

testing 1 commit(s) (applied to commit 0acebb8)
 * 146447b Bug 8714 - Poorly ordered and triggers warning in marctagstructur
      admin/marctagstructure.pl

* admin/marctagstructure.pl                                                OK
Comment 4 Paul Poulain 2012-09-17 16:27:00 UTC
Patch pushed to master
Comment 5 Chris Cormack 2012-09-18 10:38:42 UTC
Pushed to 3.8.x, will be in 3.8.5