diff --git a/core/modules/taxonomy/src/TermStorage.php b/core/modules/taxonomy/src/TermStorage.php index a1b460e..bd33bde 100644 --- a/core/modules/taxonomy/src/TermStorage.php +++ b/core/modules/taxonomy/src/TermStorage.php @@ -103,6 +103,7 @@ public function resetCache(array $ids = NULL) { $this->treeChildren = array(); $this->treeParents = array(); $this->treeTerms = array(); + $this->trees = array(); parent::resetCache($ids); } @@ -458,7 +459,7 @@ public function getNodeTerms($nids, $vocabs = array(), $langcode = NULL) { public function __sleep() { $vars = parent::__sleep(); // Do not serialize static cache. - unset($vars['parents'], $vars['parentsAll'], $vars['children'], $vars['treeChildren'], $vars['treeParents'], $vars['treeTerms']); + unset($vars['parents'], $vars['parentsAll'], $vars['children'], $vars['treeChildren'], $vars['treeParents'], $vars['treeTerms'], $var['trees']); return $vars; } @@ -474,6 +475,7 @@ public function __wakeup() { $this->treeChildren = array(); $this->treeParents = array(); $this->treeTerms = array(); + $this->trees = array(); } } diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php index 1fddcf8..a311045 100644 --- a/core/modules/taxonomy/src/Tests/TermTest.php +++ b/core/modules/taxonomy/src/Tests/TermTest.php @@ -474,7 +474,7 @@ function testTermReorder() { $this->assertEqual($terms[0]->id(), $term1->id(), 'Term 1 was moved to back above term 2.'); $this->assertEqual($terms[1]->id(), $term2->id(), 'Term 2 was moved to back below term 1.'); $this->assertEqual($terms[2]->id(), $term3->id(), 'Term 3 is still below term 2.'); - $this->assertEqual($terms[2]->parents, array($term2->id()), 'Term 3 is still a child of term 2.' . var_export($terms[1]->id(), 1)); + $this->assertEqual($terms[2]->parents, array($term2->id()), 'Term 3 is still a child of term 2.'); } /**