Skip to content

Commit

Permalink
Merge pull request #32 from b13/bugfix/issue-30
Browse files Browse the repository at this point in the history
[BUGFIX] dbal fetch method for non-composer mode
  • Loading branch information
bmack authored Dec 23, 2022
2 parents cc6c0fd + 2620dc3 commit da62860
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Classes/SlugModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit da62860

Please sign in to comment.