From 245db071cc5dabfa59f6f58f1b4768497b7f5eff Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Sun, 11 Sep 2011 20:26:41 -0400
Subject: [PATCH] - Patch #1275808 by bfroehle: use new cache bin naming in
 hook_flush_cache().

---
 includes/common.inc           | 8 ++++----
 modules/block/block.module    | 2 +-
 modules/field/field.module    | 2 +-
 modules/image/image.module    | 2 +-
 modules/system/system.api.php | 8 ++++----
 modules/system/system.module  | 8 ++++----
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/includes/common.inc b/includes/common.inc
index bb4d8e7321bd..72fcf76a8046 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -7146,10 +7146,10 @@ function drupal_flush_all_caches() {
 
   // Don't clear cache_form - in-progress form submissions may break.
   // Ordered so clearing the page cache will always be the last action.
-  $core = array('cache', 'cache_path', 'cache_filter', 'cache_bootstrap', 'cache_page');
-  $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
-  foreach ($cache_tables as $table) {
-    cache($table)->flush();
+  $core = array('cache', 'path', 'filter', 'bootstrap', 'page');
+  $cache_bins = array_merge(module_invoke_all('flush_caches'), $core);
+  foreach ($cache_bins as $bin) {
+    cache($bin)->flush();
   }
 
   // Rebuild the bootstrap module list. We do this here so that developers
diff --git a/modules/block/block.module b/modules/block/block.module
index 7f9379f30a39..86e1ca734b78 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -912,7 +912,7 @@ function block_flush_caches() {
     _block_rehash($theme->name);
   }
 
-  return array('cache_block');
+  return array('block');
 }
 
 /**
diff --git a/modules/field/field.module b/modules/field/field.module
index 9683c02b691c..8969547715dd 100644
--- a/modules/field/field.module
+++ b/modules/field/field.module
@@ -421,7 +421,7 @@ function field_system_info_alter(&$info, $file, $type) {
  */
 function field_flush_caches() {
   field_sync_field_status();
-  return array('cache_field');
+  return array('field');
 }
 
 /**
diff --git a/modules/image/image.module b/modules/image/image.module
index 1f4207374038..af683d6ba80f 100644
--- a/modules/image/image.module
+++ b/modules/image/image.module
@@ -262,7 +262,7 @@ function image_system_file_system_settings_submit($form, &$form_state) {
  * Implements hook_flush_caches().
  */
 function image_flush_caches() {
-  return array('cache_image');
+  return array('image');
 }
 
 /**
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 52350f9b9339..ec7f6b8ba892 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -2377,17 +2377,17 @@ function hook_mail($key, &$message, $params) {
 /**
  * Add a list of cache tables to be cleared.
  *
- * This hook allows your module to add cache table names to the list of cache
- * tables that will be cleared by the Clear button on the Performance page or
+ * This hook allows your module to add cache bins to the list of cache bins
+ * that will be cleared by the Clear button on the Performance page or
  * whenever drupal_flush_all_caches is invoked.
  *
  * @return
- *   An array of cache table names.
+ *   An array of cache bins.
  *
  * @see drupal_flush_all_caches()
  */
 function hook_flush_caches() {
-  return array('cache_example');
+  return array('example');
 }
 
 /**
diff --git a/modules/system/system.module b/modules/system/system.module
index cfab0a98288c..16ed0b50cecb 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -3004,10 +3004,10 @@ function system_cron() {
     }
   }
 
-  $core = array('cache', 'cache_path', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu');
-  $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
-  foreach ($cache_tables as $table) {
-    cache($table)->expire();
+  $core = array('cache', 'path', 'filter', 'page', 'form', 'menu');
+  $cache_bins = array_merge(module_invoke_all('flush_caches'), $core);
+  foreach ($cache_bins as $bin) {
+    cache($bin)->expire();
   }
 
   // Cleanup the batch table and the queue for failed batches.
-- 
GitLab