Bug 7330 - System preferences editor generates errors in the log with each search
Summary: System preferences editor generates errors in the log with each search
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: 3.8
Hardware: All All
: PATCH-Sent (DO NOT USE) minor (vote)
Assignee: Owen Leonard
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 13:31 UTC by Owen Leonard
Modified: 2013-12-05 20:01 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:


Attachments
Proposed fix (1.60 KB, patch)
2011-12-07 15:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7330 - System preferences editor generates errors in the log with each search (1.78 KB, patch)
2011-12-08 20:55 UTC, Liz Rea
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2011-12-07 13:31:57 UTC
When you search system preferences errors are generated in the log:

preferences.pl: Use of uninitialized value in pattern match (m//) at /admin/preferences.pl line 219.
preferences.pl: Use of uninitialized value $text in pattern match (m//) at /admin/preferences.pl line 252.
preferences.pl: Use of uninitialized value $text in pattern match (m//) at /admin/preferences.pl line 252.
preferences.pl: Use of uninitialized value $text in pattern match (m//) at /admin/preferences.pl line 252.
preferences.pl: Use of uninitialized value in pattern match (m//) at /admin/preferences.pl line 219.
preferences.pl: Use of uninitialized value $text in pattern match (m//) at /admin/preferences.pl line 252.
preferences.pl: Use of uninitialized value $text in pattern match (m//) at /admin/preferences.pl line 252.
preferences.pl: Use of uninitialized value $text in pattern match (m//) at /admin/preferences.pl line 252.
Comment 1 Owen Leonard 2011-12-07 15:56:26 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2011-12-08 20:55:56 UTC
Created attachment 6680 [details] [review]
Bug 7330 - System preferences editor generates errors in the log with each search

Adding a check for an empty value in a couple of places
which seem to always get one.

As far as I can tell these places in the script are looping
over ALL the data in the pref files, and sometimes an empty
value comes through. I wonder if this is because of a minor
syntax error in the pref file?

My correction is a stab in the dark since I haven't determined
where the empty value is actually coming from. This change
quiets the errors in the log and doesn't seem to affect
preference search results.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
No more messages in the logs. Yay!

Ran unit tests on this (t, xt/author, xt, t/db_dependent)- nothing out of the ordinary in any.
Comment 3 Paul Poulain 2011-12-15 16:37:13 UTC
QA comment:
well I feel I shouldn't accept a patch that says "fixes the problem, but I don't know why"... OTH, preferences.pl is poorly documented, it fixes the problem, and I couldn't find any side effect. I couldn't understand why those empty values are here though.

So:

passed QA

patch pushed, please test

chris_n = I would wisely say "don't push this on 3.6. If there is a side effect we couldn't detect, we can hope someone else will spot it in the next 4 months before 3.8 is released"