Bug 32615 - Don't crash on empty yaml sysprefs
Summary: Don't crash on empty yaml sysprefs
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-12 16:43 UTC by David Gustafsson
Modified: 2023-12-28 20:42 UTC (History)
0 users

See Also:
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 (1.17 KB, patch)
2023-01-12 16:54 UTC, David Gustafsson
Details | Diff | Splinter Review

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