Skip to content
Snippets Groups Projects
Verified Commit 99ed4332 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...

Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault plugin doesn't add cache tags

(cherry picked from commit 6d3cdb77)
parent b676d86b
No related branches found
No related tags found
7 merge requests!122353526426-warning-for-missing,!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!8325Update file Sort.php,!8095Expose document root on install
Pipeline #170553 passed
......@@ -197,6 +197,19 @@ public function getArgument() {
}
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
$tags = parent::getCacheTags();
if (!empty($this->options['node'])) {
if (($node = $this->routeMatch->getParameter('node')) && $node instanceof NodeInterface) {
$tags = Cache::mergeTags($tags, $node->getCacheTags());
}
}
return $tags;
}
/**
* {@inheritdoc}
*/
......
......@@ -61,6 +61,7 @@ public function testNodePath() {
$expected = implode(',', [$this->term1->id(), $this->term2->id()]);
$this->assertEquals($expected, $view->argument['tid']->getDefaultArgument());
$this->assertEquals($this->nodes[0]->getCacheTags(), $view->argument['tid']->getPlugin('argument_default')->getCacheTags());
$view->destroy();
}
......@@ -83,6 +84,7 @@ public function testNodePathWithViewSelection() {
$expected = implode(',', [$this->term1->id(), $this->term2->id()]);
$this->assertEquals($expected, $view->argument['tid']->getDefaultArgument());
$this->assertEquals($this->nodes[0]->getCacheTags(), $view->argument['tid']->getPlugin('argument_default')->getCacheTags());
}
public function testTermPath() {
......@@ -90,6 +92,7 @@ public function testTermPath() {
$expected = $this->term1->id();
$this->assertEquals($expected, $view->argument['tid']->getDefaultArgument());
$this->assertEmpty($view->argument['tid']->getPlugin('argument_default')->getCacheTags());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment