summaryrefslogtreecommitdiffstatshomepage
path: root/core/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/includes/common.inc')
-rw-r--r--core/includes/common.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/includes/common.inc b/core/includes/common.inc
index caf7d72f4d14..9c60a811ce30 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -10,6 +10,7 @@
use Drupal\Component\Utility\SortArray;
use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\CacheTagsPurgeInterface;
use Drupal\Core\DrupalKernel;
/**
@@ -418,6 +419,13 @@ function drupal_flush_all_caches($kernel = NULL): void {
$module_handler = \Drupal::moduleHandler();
// Flush all persistent caches.
$module_handler->invokeAll('cache_flush');
+ // Purge cache tags immediately before flushing cache bins. If a cache tag is
+ // invalidated between the tags being purged and cache bins are flushed, then
+ // it will be included in the checksum of any new cache items, but still valid
+ // because the tag was written before the creation of cache item.
+ if (($invalidator = \Drupal::service('cache_tags.invalidator')) && ($invalidator instanceof CacheTagsPurgeInterface)) {
+ $invalidator->purge();
+ }
foreach (Cache::getBins() as $cache_backend) {
$cache_backend->deleteAll();
}
@@ -488,7 +496,7 @@ function drupal_flush_all_caches($kernel = NULL): void {
* @see hook_updater_info_alter()
*/
function drupal_get_updaters() {
- @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+ @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
$updaters = &drupal_static(__FUNCTION__);
if (!isset($updaters)) {
@@ -510,7 +518,7 @@ function drupal_get_updaters() {
* @see hook_filetransfer_info_alter()
*/
function drupal_get_filetransfer_info() {
- @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+ @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
$info = &drupal_static(__FUNCTION__);
if (!isset($info)) {