diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index 7bbf1e7..f567c0f 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -10,6 +10,7 @@ use Drupal\Component\Utility\Crypt; use Drupal\Core\Database\Connection; use Drupal\Core\Database\SchemaObjectExistsException; +use Drupal\Core\Site\Settings; /** * Defines a default cache implementation. @@ -152,8 +153,8 @@ protected function prepareItem($cache, $allow_invalid) { public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) { // Get defined settings from settings.php if there are any and set the cache. $settings = Settings::get('cache_database', []); - if (isset($settings['cache_database'][$this->bin]) && $expire == Cache::PERMANENT || $expire > $settings['cache_database'][$this->bin]) { - $expire = $settings['cache_database'][$this->bin]; + if (isset($settings[$this->bin]) && ($expire == Cache::PERMANENT || $expire > $settings['cache_database'][$this->bin])) { + $expire = $settings[$this->bin]; } Cache::validateTags($tags); $tags = array_unique($tags);