Bug 8799

Summary: Non-existing analytics field triggers error log
Product: Koha Reporter: Mark Tompsett <mtompset>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED INVALID QA Contact:
Severity: minor    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Mark Tompsett 2012-09-21 00:39:36 UTC
[Wed Sep 19 18:53:14 2012] [error] [client 192.168.100.2] [Wed Sep 19 18:53:14 2012] opac-search.pl: Use of uninitialized value in split at /usr/share/koha/opac/cgi-bin/opac/opac-search.pl line 394.

This is the end of a loop, which generally means the loop condition is the problem.

my $analyticfield = '773';
if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC'){
    $analyticfield = '773';
} elsif ($marcflavour eq 'UNIMARC') {
    $analyticfield = '461';
}
foreach my $hostfield ( $record->field($analyticfield)) {

I am positive that our records do not have any 773 fields. So a simple if (defined(...)) { ... } around the loop should solve the error log flooding, as analytic fields are not required, as far as I know.

This applies to 3.6.x, 3.8.x, and master.
Comment 1 Mark Tompsett 2012-09-21 07:11:43 UTC
Though it may be valid, I believe I was confusing opac-detail and opac-search (as I have a list of bugs to confirm/check against 3.6.x and newer since they were triggered in our 3.6.3). Not going to fix, because don't know if that is really a problem.