By alexpott on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
9.3.x
Introduced in version:
9.3.0
Issue links:
Description:
The protected method \Drupal\Core\Cache\DatabaseCacheTagsChecksum::catchException() is deprecated with no replacement. If you have code that extends \Drupal\Core\Cache\DatabaseCacheTagsChecksum and calls \Drupal\Core\Cache\DatabaseCacheTagsChecksum::ensureTableExists then the code should throw the exception itself.
Before
try {
foreach ($tags as $tag) {
$this->connection->merge('cachetags')
->insertFields(['invalidations' => 1])
->expression('invalidations', '[invalidations] + 1')
->key('tag', $tag)
->execute();
}
}
catch (\Exception $e) {
// Create the cache table, which will be empty. This fixes cases during
// core install where cache tags are invalidated before the table is
// created.
if (!$this->ensureTableExists()) {
$this->catchException($e);
}
}
After
try {
foreach ($tags as $tag) {
$this->connection->merge('cachetags')
->insertFields(['invalidations' => 1])
->expression('invalidations', '[invalidations] + 1')
->key('tag', $tag)
->execute();
}
}
catch (\Exception $e) {
// Create the cache table, which will be empty. This fixes cases during
// core install where cache tags are invalidated before the table is
// created.
if (!$this->ensureTableExists()) {
throw $e;
}
}