Bug 11135

Summary: Parsing of OVERRIDE_SYSPREF_NAMES logs warnings
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: Architecture, internals, and plumbingAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: gmcharlt, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
Bug 11135 Check variable exists before splitting

Description Colin Campbell 2013-10-24 15:56:40 UTC
The recently added environment variable OVERRIDE_SYSPREF_NAMES is parsed using split but most of the time we're splitting an undefined variable. This fills the error log with warnings, so we should check theres something to split before executing it
Comment 1 Colin Campbell 2013-10-24 16:09:09 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2013-10-31 12:02:12 UTC
Created attachment 22632 [details] [review]
Bug 11135 Check variable exists before splitting

calling split on an undefined var generates warning to
the log. Lets check it exists before processing it

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2013-10-31 12:03:42 UTC
As an exception to the rule, I take the liberty to sign off and pass qa in one run. This is a trivial patch that eliminates just another warning from the logs.
Good catch.
Comment 4 Galen Charlton 2013-10-31 14:26:53 UTC
Pushed to master, along with a pendantic follow-up.  Thanks, Colin!

I sure wish there were a less verbose way to simultaneously check that a hash key is present and that the value of it is defined, but c'est la vie.