Skip to content

Commit

Permalink
[BUGFIX] Build correct database query in StaticDatabaseMapper
Browse files Browse the repository at this point in the history
The class `T3G\AgencyPack\Blog\Routing\Aspect\StaticDatabaseMapper` now
builds propert conditions in the used SQL query.
  • Loading branch information
andreaskienast committed Sep 12, 2023
1 parent c87764f commit 4ba5e6f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Classes/Routing/Aspect/StaticDatabaseMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ protected function buildValues(): array
$queryBuilder->groupBy($this->groupBy);
}

if (count($this->where) > 0) {
foreach ($this->where as $key => $value) {
$queryBuilder->andWhere($key, $queryBuilder->createNamedParameter($value));
}
foreach ($this->where as $key => $value) {
$queryBuilder->andWhere($queryBuilder->expr()->eq($key, $queryBuilder->createNamedParameter($value)));
}

return array_map('strval', array_column($queryBuilder->executeQuery()->fetchAllAssociative(), $this->field));
Expand Down

0 comments on commit 4ba5e6f

Please sign in to comment.