Bug 8799 - Non-existing analytics field triggers error log
Summary: Non-existing analytics field triggers error log
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-21 00:39 UTC by Mark Tompsett
Modified: 2014-12-07 20:02 UTC (History)
0 users

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


Attachments

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