From 4ba5e6fb1ee008a761d2d4ef2b5dec498c87bf01 Mon Sep 17 00:00:00 2001 From: Andreas Fernandez Date: Tue, 12 Sep 2023 10:10:38 +0200 Subject: [PATCH] [BUGFIX] Build correct database query in `StaticDatabaseMapper` The class `T3G\AgencyPack\Blog\Routing\Aspect\StaticDatabaseMapper` now builds propert conditions in the used SQL query. --- Classes/Routing/Aspect/StaticDatabaseMapper.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Classes/Routing/Aspect/StaticDatabaseMapper.php b/Classes/Routing/Aspect/StaticDatabaseMapper.php index 36904d72..22f20f26 100644 --- a/Classes/Routing/Aspect/StaticDatabaseMapper.php +++ b/Classes/Routing/Aspect/StaticDatabaseMapper.php @@ -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));