From 4c37ea7ec92ab8f20734f8348203e529f5ca1982 Mon Sep 17 00:00:00 2001 From: Ernesto Baschny Date: Fri, 30 Jan 2026 17:32:38 +0100 Subject: [PATCH 1/3] Adapt code to work with PHP 8.3 and TYPO3 v13 --- Classes/Command/ExportCommand.php | 10 +++++----- Classes/TceMain.php | 2 +- composer.json | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Classes/Command/ExportCommand.php b/Classes/Command/ExportCommand.php index 70754ac..1480fdf 100644 --- a/Classes/Command/ExportCommand.php +++ b/Classes/Command/ExportCommand.php @@ -89,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $yamlConfiguration = []; foreach (BeGroup::getAllowedFields() as $fieldName) { - $yamlConfiguration[$fieldName] = GeneralUtility::trimExplode(',', $group[$fieldName], true); + $yamlConfiguration[$fieldName] = GeneralUtility::trimExplode(',', $group[$fieldName] ?? '', true); } $yamlFileContents = Yaml::dump($yamlConfiguration, 99, 2); @@ -139,9 +139,9 @@ protected function getGroupRecord($groupUid) $rows = $queryBuilder ->select('*') ->from('be_groups') - ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, \PDO::PARAM_INT))) - ->execute() - ->fetch(); + ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT))) + ->executeQuery() + ->fetchAssociative(); return $rows; } @@ -152,7 +152,7 @@ protected function updateGroupRecord($groupUid, $file) $queryBuilder ->update('be_groups') ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->set('tx_aclsfromhell_file', $file); diff --git a/Classes/TceMain.php b/Classes/TceMain.php index 1562b28..da85a1c 100644 --- a/Classes/TceMain.php +++ b/Classes/TceMain.php @@ -6,7 +6,7 @@ class TceMain { - public function renderFiles(array &$config) + public function renderFiles(array &$config): void { if (empty($config['items'])) { $config['items'][] = ['', null]; diff --git a/composer.json b/composer.json index 867681c..5ecd7f8 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "license": "MIT", "type": "typo3-cms-extension", "require": { - "typo3/cms-core": "^11.5 || ^12.4" + "php": "^8.3", + "typo3/cms-core": "^11.5 || ^12.4 || ^13.4" }, "autoload": { "psr-4": { From e1527710768fc0cba502018012cdc975587df7b7 Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Sat, 31 Jan 2026 15:53:18 +0100 Subject: [PATCH 2/3] Use use statements --- Classes/Command/ExportCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/Command/ExportCommand.php b/Classes/Command/ExportCommand.php index 1480fdf..4441ef0 100644 --- a/Classes/Command/ExportCommand.php +++ b/Classes/Command/ExportCommand.php @@ -10,6 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Yaml\Yaml; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -139,7 +140,7 @@ protected function getGroupRecord($groupUid) $rows = $queryBuilder ->select('*') ->from('be_groups') - ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT))) + ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, Connection::PARAM_INT))) ->executeQuery() ->fetchAssociative(); @@ -152,7 +153,7 @@ protected function updateGroupRecord($groupUid, $file) $queryBuilder ->update('be_groups') ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($groupUid, Connection::PARAM_INT)) ) ->set('tx_aclsfromhell_file', $file); From 5cd97b90f43ce335f6d0034595e50cbe2e525e12 Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Sat, 31 Jan 2026 15:54:33 +0100 Subject: [PATCH 3/3] FIX: QueryBuilder->execute() is gone in v13 The split into executeQuery() and executeStatement() got introduced in v11, so this outta be compatible with 11, 12 and 13. --- Classes/Command/ExportCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/ExportCommand.php b/Classes/Command/ExportCommand.php index 4441ef0..9ea0ce4 100644 --- a/Classes/Command/ExportCommand.php +++ b/Classes/Command/ExportCommand.php @@ -161,6 +161,6 @@ protected function updateGroupRecord($groupUid, $file) $queryBuilder->set($fieldName, null); } - $queryBuilder->execute(); + $queryBuilder->executeStatement(); } }