-
Bug
-
Resolution: Fixed
-
Blocker
-
4.0.9, 4.1.4, 4.2.1
-
1
-
Team Hedgehog 2023 Sprint 2.2
If a statically accelerated cache returns an empty array then the value is still fetched from the non-static cache store.
This happens because the result check is not strict enough.
Specifcally, MDL-72837 introduced a change from:
if ($result === false) {
|
To:
if (!$result) {
|
In the case of values such as:
- 0
- null
- []
- ''
This will lead to both the static cache, and its parent cache being hit. In typical use when the static cache encounters a hit, it should not defer to the parent cache. Because the value test was not strict, these additional values were inlcuded and treated as though they had no value.
This change:
- addresses each of the locations where there was a non-strict result check; and
- introduces a new cache_helper::result_found(mixed $value): bool helper which should be used within the cache API
- is a regression caused by
-
MDL-72837 core_cache: Cache API should support versioned data
-
- Closed
-