Bug 32615

Summary: Don't crash on empty yaml sysprefs
Product: Koha Reporter: David Gustafsson <glasklas>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 32615: Don't crash on empty yaml sysprefs

Description David Gustafsson 2023-01-12 16:43:50 UTC
It appears that empty sysprefs will cause C4::Context->yaml_preference to crash. This patch should fix that so that yaml preference values don't cause any issues.
Comment 1 David Gustafsson 2023-01-12 16:54:50 UTC
Created attachment 145239 [details] [review]
Bug 32615: Don't crash on empty yaml sysprefs

To test:
  1) Apply patch
  2) Verify tests in t/Context.t pass
Comment 2 David Gustafsson 2023-01-12 16:57:58 UTC
I now realized it's only when adding a new syspref, setting the initial value to NULL that this is an issue. So very much of an edge case. I still don't see the harm of fixing this, but it's a very minor issue indeed.
Comment 3 David Gustafsson 2023-01-12 17:11:22 UTC
Closing this one, I made a mistake testing this and appears undef/null values actually don't cause any issues.