Bug 36238

Summary: C4::Context->preference doesn't cache values for non-existent sysprefs
Product: Koha Reporter: David Cook <dcook>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

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.