From 6debc131668a096c7fab54f06a09b951809744b0 Mon Sep 17 00:00:00 2001 From: mueller-sebastian Date: Fri, 10 Dec 2021 13:31:06 +0100 Subject: [PATCH] Fix category selection in direct_mail module step 3 Resolves #280 --- Classes/DirectMailUtility.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/DirectMailUtility.php b/Classes/DirectMailUtility.php index d8900c4ce..2cd6d9ba5 100644 --- a/Classes/DirectMailUtility.php +++ b/Classes/DirectMailUtility.php @@ -684,8 +684,10 @@ public static function makeCategories($table, array $row, $sysLanguageUid) $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_dmail_category'); $res = $queryBuilder->select('*') ->from('sys_dmail_category') - ->add('where', 'sys_dmail_category.pid IN (' . str_replace(',', "','", $queryBuilder->createNamedParameter($pidList)) . ')' . - ' AND l18n_parent=0') + ->where( + $queryBuilder->expr()->in('sys_dmail_category.pid', $queryBuilder->createNamedParameter(explode(',', $pidList), Connection::PARAM_INT_ARRAY)), + $queryBuilder->expr()->eq('sys_dmail_category.l18n_parent', $queryBuilder->createNamedParameter(0, Connection::PARAM_INT)) + ) ->execute(); while (($rowCat = $res->fetch())) { if (($localizedRowCat = self::getRecordOverlay('sys_dmail_category', $rowCat, $sysLanguageUid, ''))) {