summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-07-24 21:25:41 (GMT)
committerAlex Pott2015-07-24 21:25:41 (GMT)
commit626f64d83bce02f80bee9d0f514a0dc4ee494c18 (patch)
treece8cf7504085af73d11a2cc86f5fd7fb1d512df6
parent4b12bbf0db2ba83990710d9bea9cabf6c451aa83 (diff)
Revert "Issue #2492429 by mikeryan: Migration count caching broken"
This reverts commit c523c9956783aa9371889f2100acf8156757a125.
-rw-r--r--core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateSourceTest.php8
2 files changed, 5 insertions, 7 deletions
diff --git a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
index 51cdcda..2ebcbba 100644
--- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
@@ -423,7 +423,7 @@ abstract class SourcePluginBase extends PluginBase implements MigrateSourceInter
// class to get the count from the source.
if ($refresh || !$this->cacheCounts) {
$count = $this->getIterator()->count();
- $this->getCache()->set($this->cacheKey, $count);
+ $this->getCache()->set($this->cacheKey, $count, 'cache');
}
else {
// Caching is in play, first try to retrieve a cached count.
@@ -436,7 +436,7 @@ abstract class SourcePluginBase extends PluginBase implements MigrateSourceInter
// No cached count, ask the derived class to count 'em up, and cache
// the result.
$count = $this->getIterator()->count();
- $this->getCache()->set($this->cacheKey, $count);
+ $this->getCache()->set($this->cacheKey, $count, 'cache');
}
}
return $count;
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php
index 72d7b49..d6e726a 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php
@@ -139,12 +139,10 @@ class MigrateSourceTest extends MigrateTestCase {
* Test that the source count is correct.
*/
public function testCount() {
- // Use the Apcu cache backend, which confirms that the cache API is being
- // properly used.
+
$container = new ContainerBuilder();
- $cache_tags_checksum = $this->getMock('\Drupal\Core\Cache\CacheTagsChecksumInterface');
- $container->register('cache.migrate', 'Drupal\Core\Cache\ApcuBackend')
- ->setArguments(['migrate', 'migrate', $cache_tags_checksum]);
+ $container->register('cache.migrate', 'Drupal\Core\Cache\NullBackend')
+ ->setArguments(['migrate']);
\Drupal::setContainer($container);
// Test that the basic count works.