Skip to content

Commit

Permalink
Merge tag '2.2.3'
Browse files Browse the repository at this point in the history
Hotfix release 2.2.3

Fix filter IN/NOTIN
  • Loading branch information
stefanheimes committed May 14, 2023
2 parents a910846 + 69a9e67 commit e58c706
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .check-author.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ mapping:
- "xantippe <[email protected]>"
- "zonky2 <[email protected]>"
- "e-spin <[email protected]>"
- "e-spin <[email protected]>"
13 changes: 10 additions & 3 deletions src/Data/DefaultDataProviderDBalUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2020 Contao Community Alliance.
* (c) 2013-2023 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -14,7 +14,7 @@
* @author Sven Baumann <[email protected]>
* @author Richard Henkenjohann <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2020 Contao Community Alliance.
* @copyright 2013-2023 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand Down Expand Up @@ -355,9 +355,16 @@ private static function filterInOrNotInList($operation, QueryBuilder $queryBuild
{
$expressionMethod = lcfirst(preg_replace('/\s+/', '', ucwords(strtolower($operation['operation']))));

$values = [];
foreach ($operation['values'] as $index => $value) {
$parameterName = $operation['property'] . '_in_' . $index;
$values[] = ':' . $parameterName;
$queryBuilder->setParameter($parameterName, $value);
}

return $queryBuilder
->expr()
->{$expressionMethod}($operation['property'], $operation['values']);
->{$expressionMethod}($operation['property'], $values);
}

/**
Expand Down

0 comments on commit e58c706

Please sign in to comment.