Bug 36238 - C4::Context->preference doesn't cache values for non-existent sysprefs
Summary: C4::Context->preference doesn't cache values for non-existent sysprefs
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 01:28 UTC by David Cook
Modified: 2024-03-06 01:28 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 David Cook 2024-03-06 01:28:39 UTC
If you try to look up a system preference that doesn't exist, C4::Context won't cache a value for it.

Overall, it is logical not to cache a system preference that doesn't exist in the systempreferences database table.

However, maybe you distribute a plugin or template which uses a local system preference, and it only exists in some systems. On the systems missing the preference, you'll be doing a database call every time instead of using the cached value of nothing.

This is suboptimal from a performance perspective.