From 2620dc3b20d7c8392669cc3e9ad58b2477f745bf Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Fri, 23 Dec 2022 13:24:09 +0100 Subject: [PATCH] [BUGFIX] dbal fetch method for non-composer mode Fixes: #30 --- Classes/SlugModifier.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Classes/SlugModifier.php b/Classes/SlugModifier.php index 097b663..d490154 100644 --- a/Classes/SlugModifier.php +++ b/Classes/SlugModifier.php @@ -14,6 +14,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\DataHandling\SlugHelper; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\TypoScript\TypoScriptService; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -79,13 +80,17 @@ protected function resolveHookParameters(array $configuration, string $tableName if (isset($record['uid'])) { // load full record from db (else: it is a new record) $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages'); - $row = $queryBuilder->select('*') + $stm = $queryBuilder->select('*') ->from('pages') ->where( $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)) ) - ->execute() - ->fetchAssociative(); + ->execute(); + if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() === 10) { + $row = $stm->fetch(); + } else { + $row = $stm->fetchAssociative(); + } if ($row !== false) { $this->recordData = $row; }