Skip to content

Commit 292640e

Browse files
committed
Fix: filter helpers now accepts non array arguments
fix #7
1 parent 9a69c05 commit 292640e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Classes/FlowQuery/Operations/FilterByCategoriesOperation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FilterByCategoriesOperation extends FilterByReferencesOperation
2323
public function evaluate(FlowQuery $flowQuery, array $arguments)
2424
{
2525
if (!is_array($arguments[0])) {
26-
throw new FlowQueryException('The first parameter of '.self::$shortName.' should be an array');
26+
$arguments[1] = [ $arguments[1] ];
2727
}
2828

2929
$context = \array_filter($flowQuery->getContext(), $this->getReferenceFilter('categories', $arguments[0]));

Classes/FlowQuery/Operations/FilterByTagsOperation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FilterByTagsOperation extends FilterByReferencesOperation
2323
public function evaluate(FlowQuery $flowQuery, array $arguments)
2424
{
2525
if (!is_array($arguments[0])) {
26-
throw new FlowQueryException('The first parameter of '.self::$shortName.' should be an array');
26+
$arguments[1] = [ $arguments[1] ];
2727
}
2828

2929
$context = \array_filter($flowQuery->getContext(), $this->getReferenceFilter('tags', $arguments[0]));

0 commit comments

Comments
 (0)