summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2011-08-26 09:14:57 (GMT)
committerDries Buytaert2011-08-26 09:14:57 (GMT)
commitebfd886f16d7df09758734450e3e7d53948606c7 (patch)
tree48667d783d6733860b9ffe29537e4291a5b31510
parentaa0781275cd0aa6ce6400194c6352aeeda2406ef (diff)
- Patch #1259096 by Akaoni: cache Bin cache_path() is never cleaned up.
-rw-r--r--includes/common.inc2
-rw-r--r--modules/simpletest/tests/cache.test21
-rw-r--r--modules/system/system.module2
3 files changed, 23 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 1e287f8..1ef681f 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -7138,7 +7138,7 @@ 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_filter', 'cache_bootstrap', 'cache_page');
+ $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_clear_all('*', $table, TRUE);
diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index 43d1fa1..954f575 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -310,6 +310,27 @@ class CacheClearCase extends CacheTestCase {
|| $this->checkCacheExists('test_cid_clear3', $this->default_value),
t('All cache entries removed when the array exceeded the cache clear threshold.'));
}
+
+ /**
+ * Test drupal_flush_all_caches().
+ */
+ function testFlushAllCaches() {
+ // Create cache entries for each flushed cache bin.
+ $bins = array('cache', 'cache_filter', 'cache_page', 'cache_boostrap', 'cache_path');
+ $bins = array_merge(module_invoke_all('flush_caches'), $bins);
+ foreach ($bins as $id => $bin) {
+ $id = 'test_cid_clear' . $id;
+ cache_set($id, $this->default_value, $bin);
+ }
+
+ // Remove all caches then make sure that they are cleared.
+ drupal_flush_all_caches();
+
+ foreach ($bins as $id => $bin) {
+ $id = 'test_cid_clear' . $id;
+ $this->assertFalse($this->checkCacheExists($id, $this->default_value, $bin), t('All cache entries removed from @bin.', array('@bin' => $bin)));
+ }
+ }
}
/**
diff --git a/modules/system/system.module b/modules/system/system.module
index 946ef0c..3737af1 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -3004,7 +3004,7 @@ function system_cron() {
}
}
- $core = array('cache', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu');
+ $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_clear_all(NULL, $table);