Problem/Motivation
Currently, the actual store used to provide the expirable KV storage is supposed to be defined by the factory.keyvalue.expirable
parameter, which defaults to default: keyvalue.expirable.database
.
However, this fallback is duplicated in KeyValueFactory::get()
, which does this:
if (!isset($this->stores[$collection])) {
if (isset($this->options[$collection])) {
$service_id = $this->options[$collection];
}
elseif (isset($this->options[static::DEFAULT_SETTING])) { // 'keyvalue_expirable_default', not 'default'
$service_id = $this->options[static::DEFAULT_SETTING];
}
else {
$service_id = static::DEFAULT_SERVICE;
}
As a result, if a specific store is not provided when trying to instantiate an expirable KV store, the first and second checks fail because the default parameter is called default
in core.services.yml
but used as keyvalue_expirable_default
in code, so the logic falls back to the value of KeyValueExpirableFactory::DEFAULT_SERVICE
.
AFAICS, we have five use cases in core for this: form_cache
(see
#2183275: Use cache for $form, kv for $form_state β
), update.manager
, update.manager
, update.processor
, user.private_tempstore
and user.shared_tempstore
.
There are two possible fixes: the simplest one is to change the factory.keyvalue.expirable
section in default.services.yml
, the better one is to fix that logic to use default
.
Steps to reproduce
TBD
Proposed resolution
TBD
Remaining tasks
Determine if this is a fix we want to add
If yes determine best patch forward
BC layer + tests
Code review
If no close as works as designed
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Release notes snippet
TBD