From f38178e6aa43297ef8b9e08ca1bcb6bd49c81473 Mon Sep 17 00:00:00 2001 From: Torrance Date: Wed, 5 Aug 2015 15:24:00 +1200 Subject: [PATCH] Avoid CiviCRM running full drupal cache flush, as this results in CiviCRM clobbering Drupal's Symfony with its own. --- CRM/Utils/System/Drupal8.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index 9a714a7d07..7de4b71509 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -540,4 +540,15 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { return 'sidebar_first'; } + /** + * @inheritDoc + */ + public function flush() { + // CiviCRM and Drupal both provide (different versions of) Symfony (and possibly share other classes too). + // If we call drupal_flush_all_caches(), Drupal will attempt to rediscover all of its classes, use Civicrm's + // alternatives instead and then die. Instead, we only clear cache bins and no more. + foreach (Drupal\Core\Cache\Cache::getBins() as $service_id => $cache_backend) { + $cache_backend->deleteAll(); + } + } } -- 2.25.1