Skip to content
Snippets Groups Projects
Commit 07e7d77c authored by Fredric Mitchell's avatar Fredric Mitchell Committed by Lee Rowlands
Browse files

Issue #3475831 by thony1199, fmitchell: Fix type error in...

Issue #3475831 by thony1199, fmitchell: Fix type error in TaxonomyEntityIndexDepth: abs() expects int|float, string given
parent 009ceb46
No related branches found
No related tags found
1 merge request!13Issue #3475831 by thony1199, fmitchell: Fix type error in TaxonomyEntityIndexDepth
Pipeline #288651 passed with warnings
...@@ -121,14 +121,14 @@ class TaxonomyEntityIndexTidDepth extends TaxonomyIndexTidDepth implements Conta ...@@ -121,14 +121,14 @@ class TaxonomyEntityIndexTidDepth extends TaxonomyIndexTidDepth implements Conta
if ($this->options['depth'] > 0) { if ($this->options['depth'] > 0) {
$subquery->leftJoin('taxonomy_term__parent', 'th', "th.entity_id = tei.tid"); $subquery->leftJoin('taxonomy_term__parent', 'th', "th.entity_id = tei.tid");
$last = "th"; $last = "th";
foreach (range(1, abs($this->options['depth'])) as $count) { foreach (range(1, abs((int)$this->options['depth'])) as $count) {
$subquery->leftJoin('taxonomy_term__parent', "th$count", "$last.parent_target_id = th$count.entity_id"); $subquery->leftJoin('taxonomy_term__parent', "th$count", "$last.parent_target_id = th$count.entity_id");
$where->condition("th$count.entity_id", $this->value, $operator); $where->condition("th$count.entity_id", $this->value, $operator);
$last = "th$count"; $last = "th$count";
} }
} }
elseif ($this->options['depth'] < 0) { elseif ($this->options['depth'] < 0) {
foreach (range(1, abs($this->options['depth'])) as $count) { foreach (range(1, abs((int)$this->options['depth'])) as $count) {
$subquery->leftJoin('taxonomy_term__parent', "th$count", "$last.entity_id = th$count.parent_target_id"); $subquery->leftJoin('taxonomy_term__parent', "th$count", "$last.entity_id = th$count.parent_target_id");
$where->condition("th$count.entity_id", $this->value, $operator); $where->condition("th$count.entity_id", $this->value, $operator);
$last = "th$count"; $last = "th$count";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment