diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php index 46151b6..8d6c887 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php @@ -118,7 +118,7 @@ public function setMultiple(array $data) { $this->keyValueStore->setMultiple($data); foreach ($data as $key => $value) { parent::set($key, $value); - $this->keysToPersist[$key] = $value; + $this->persist($key); } } @@ -136,7 +136,7 @@ public function set($key, $value) { */ public function deleteAll() { $this->keyValueStore->deleteAll(); - $this->cache->delete($this->cid); + $this->clear(); } } diff --git a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php index 0fd7e1b..3ce1fec 100644 --- a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php +++ b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php @@ -59,7 +59,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('config.factory')->get('search.settings'), $container->get('module_handler'), - $container->get('keyvalue')->get('state') + $container->get('state') ); } diff --git a/core/modules/system/lib/Drupal/system/Form/CronForm.php b/core/modules/system/lib/Drupal/system/Form/CronForm.php index c9b91b2..ecd6e45 100644 --- a/core/modules/system/lib/Drupal/system/Form/CronForm.php +++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php @@ -10,6 +10,7 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\Context\ContextInterface; use Drupal\Core\KeyValueStore\KeyValueFactory; +use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Drupal\system\SystemConfigFormBase; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -36,9 +37,9 @@ class CronForm extends SystemConfigFormBase { * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state * The state key value store. */ - public function __construct(ConfigFactory $config_factory, ContextInterface $context, KeyValueFactory $key_value_factory) { + public function __construct(ConfigFactory $config_factory, ContextInterface $context, KeyValueStoreInterface $state) { parent::__construct($config_factory, $context); - $this->state = $key_value_factory->get('state'); + $this->state = $state; } /** @@ -48,7 +49,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('config.factory'), $container->get('config.context.free'), - $container->get('keyvalue') + $container->get('state') ); } diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/CacheDecoratorTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/CacheDecoratorTest.php index 13ba742..0456996 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/CacheDecoratorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/CacheDecoratorTest.php @@ -66,7 +66,7 @@ public function testCache() { $this->assertEqual($stores[$i]->get('key'), $this->objects[$i]); // Reset the cache and make sure the value was updated. - $stores[$i]->reset(); + $stores[$i]->clear(); $this->assertNull($stores[$i]->get('key')); } }