From 292640e919af9314ca6ae5115fec570ab314cecb Mon Sep 17 00:00:00 2001 From: Marvin Kuhn Date: Wed, 12 Jun 2019 15:59:47 +0200 Subject: [PATCH] Fix: filter helpers now accepts non array arguments fix #7 --- Classes/FlowQuery/Operations/FilterByCategoriesOperation.php | 2 +- Classes/FlowQuery/Operations/FilterByTagsOperation.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/FlowQuery/Operations/FilterByCategoriesOperation.php b/Classes/FlowQuery/Operations/FilterByCategoriesOperation.php index 84c4149..cfd4539 100644 --- a/Classes/FlowQuery/Operations/FilterByCategoriesOperation.php +++ b/Classes/FlowQuery/Operations/FilterByCategoriesOperation.php @@ -23,7 +23,7 @@ class FilterByCategoriesOperation extends FilterByReferencesOperation public function evaluate(FlowQuery $flowQuery, array $arguments) { if (!is_array($arguments[0])) { - throw new FlowQueryException('The first parameter of '.self::$shortName.' should be an array'); + $arguments[1] = [ $arguments[1] ]; } $context = \array_filter($flowQuery->getContext(), $this->getReferenceFilter('categories', $arguments[0])); diff --git a/Classes/FlowQuery/Operations/FilterByTagsOperation.php b/Classes/FlowQuery/Operations/FilterByTagsOperation.php index 0a476ca..f86fed3 100644 --- a/Classes/FlowQuery/Operations/FilterByTagsOperation.php +++ b/Classes/FlowQuery/Operations/FilterByTagsOperation.php @@ -23,7 +23,7 @@ class FilterByTagsOperation extends FilterByReferencesOperation public function evaluate(FlowQuery $flowQuery, array $arguments) { if (!is_array($arguments[0])) { - throw new FlowQueryException('The first parameter of '.self::$shortName.' should be an array'); + $arguments[1] = [ $arguments[1] ]; } $context = \array_filter($flowQuery->getContext(), $this->getReferenceFilter('tags', $arguments[0]));