X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FPlugin%2Fviews%2Ffilter%2FTaxonomyIndexTidDepth.php;h=ebb5b51f22147d257acfa38ccaf4e00fa4b1a165;hp=802786e4674cb82c21147c1c58dbe2a9d7c58ba9;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php b/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php index 802786e46..ebb5b51f2 100644 --- a/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php +++ b/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php @@ -77,18 +77,19 @@ class TaxonomyIndexTidDepth extends TaxonomyIndexTid { $last = "tn"; if ($this->options['depth'] > 0) { - $subquery->leftJoin('taxonomy_term_hierarchy', 'th', "th.tid = tn.tid"); + $subquery->leftJoin('taxonomy_term__parent', 'th', "th.entity_id = tn.tid"); $last = "th"; foreach (range(1, abs($this->options['depth'])) as $count) { - $subquery->leftJoin('taxonomy_term_hierarchy', "th$count", "$last.parent = th$count.tid"); - $where->condition("th$count.tid", $this->value, $operator); + $subquery->leftJoin('taxonomy_term__parent', "th$count", "$last.parent_target_id = th$count.entity_id"); + $where->condition("th$count.entity_id", $this->value, $operator); $last = "th$count"; } } elseif ($this->options['depth'] < 0) { foreach (range(1, abs($this->options['depth'])) as $count) { - $subquery->leftJoin('taxonomy_term_hierarchy', "th$count", "$last.tid = th$count.parent"); - $where->condition("th$count.tid", $this->value, $operator); + $field = $count == 1 ? 'tid' : 'entity_id'; + $subquery->leftJoin('taxonomy_term__parent', "th$count", "$last.$field = th$count.parent_target_id"); + $where->condition("th$count.entity_id", $this->value, $operator); $last = "th$count"; } }