From 31c24a115b90745c74b836ba639c31de3d24d3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nitzsche?= Date: Thu, 21 May 2026 22:09:06 +0200 Subject: [PATCH 1/4] Backend module broken in t3 11 #368 * access to request fixed * access to language tool fixed * form builder fixed * branch-alias added --- Classes/Backend/Form/FormBuilder.php | 4 +++- Classes/Backend/Module/BaseModFunc.php | 5 ++++- Classes/Backend/Module/BaseModule.php | 13 +++++++++---- composer.json | 4 ++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Classes/Backend/Form/FormBuilder.php b/Classes/Backend/Form/FormBuilder.php index d0cb44e7..761dc66f 100644 --- a/Classes/Backend/Form/FormBuilder.php +++ b/Classes/Backend/Form/FormBuilder.php @@ -136,7 +136,9 @@ protected function compileFormData($table, $uid, $record) 'returnUrl' => '', ]; } - $formDataCompilerInput['request'] = $this->module->getRequest(); + if (TYPO3::isTYPO121OrHigher()) { + $formDataCompilerInput['request'] = $this->module->getRequest(); + } if (TYPO3::isTYPO130OrHigher()) { $this->formDataCache[$cacheKey] = $this->formDataCompiler->compile($formDataCompilerInput, tx_rnbase::makeInstance(TcaDatabaseRecord::class)); diff --git a/Classes/Backend/Module/BaseModFunc.php b/Classes/Backend/Module/BaseModFunc.php index f9f5338e..dde79f4f 100644 --- a/Classes/Backend/Module/BaseModFunc.php +++ b/Classes/Backend/Module/BaseModFunc.php @@ -41,7 +41,10 @@ abstract class BaseModFunc implements IModFunc /* @var $mod IModule */ protected $mod; - private function init(IModule $module, $conf) + /** + * make private when t3 11 support is dropped. + */ + public function init(IModule $module, $conf) { $this->mod = $module; } diff --git a/Classes/Backend/Module/BaseModule.php b/Classes/Backend/Module/BaseModule.php index d23ca059..29101ee4 100644 --- a/Classes/Backend/Module/BaseModule.php +++ b/Classes/Backend/Module/BaseModule.php @@ -82,12 +82,16 @@ abstract class BaseModule extends BaseScriptClass implements IModule /** @var string */ protected $selector; + /** @var ServerRequestInterface */ + protected $request = null; + protected $languageTool = null; /** * Initializes the backend module by setting internal variables, initializing the menu. */ public function init() { + $this->languageTool = tx_rnbase::makeInstance(LanguageTool::class); parent::init(); if (0 === $this->id) { @@ -102,7 +106,7 @@ public function init() */ public function getRequest(): ?ServerRequestInterface { - return null; + return $this->request; } /** @@ -130,6 +134,7 @@ public function __invoke( $response = null ) { $GLOBALS['MCONF']['script'] = '_DISPATCH'; + $this->request = $request; $this->init(); $this->main($request); @@ -185,7 +190,7 @@ protected function prepareModuleParts($parts) $parts->setContent($this->moduleContent()); $parts->setButtons($this->getButtons()); - $parts->setTitle($this->getFormTool()->getLanguageService()->getLL('title')); + $parts->setTitle($this->getLanguageService()->getLL('title')); $parts->setFuncMenu($this->getFuncMenu()); // if we got no array the user got no permissions for the // selected page or no page is selected @@ -258,7 +263,7 @@ public function getFormTool() { if (!$this->formTool) { $this->formTool = tx_rnbase::makeInstance(ToolBox::class); - $this->formTool->init($this->getDoc(), $this); + $this->formTool->init($this->getModTemplate()->getDoc(), $this); } return $this->formTool; @@ -654,6 +659,6 @@ public function getRouteIdentifier() */ public function getLanguageService() { - return $this->getFormTool()->getLanguageService(); + return $this->languageTool; } } diff --git a/composer.json b/composer.json index bfa74d9b..8e77333c 100644 --- a/composer.json +++ b/composer.json @@ -159,8 +159,8 @@ ] }, "branch-alias": { - "dev-master": "1.19.x-dev", - "dev-upgrade/typo3_13": "1.19.x-dev" + "dev-master": "1.20.x-dev", + "dev-bugfix/t3-11-module-error": "1.20.x-dev" } } } From f19f9547680a8245c2da248477d1335937d8867b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nitzsche?= Date: Thu, 21 May 2026 22:16:07 +0200 Subject: [PATCH 2/4] Backend module broken in t3 11 #368 * fix code style --- Classes/Backend/Module/BaseModule.php | 28 +++++++++---------- Classes/Backend/Template/ModuleTemplate.php | 4 +-- Classes/Configuration/Processor.php | 4 +-- Classes/Database/ResultIterator.php | 7 ++--- .../Frontend/Controller/MainController.php | 4 +-- Classes/Search/SearchBase.php | 13 ++++----- Classes/Utility/Arrays.php | 2 +- Classes/Utility/Misc.php | 6 ++-- Classes/Utility/Spyc.php | 4 +-- Classes/Utility/TYPO3.php | 4 +-- Classes/Utility/XmlElement.php | 11 ++++---- 11 files changed, 40 insertions(+), 47 deletions(-) diff --git a/Classes/Backend/Module/BaseModule.php b/Classes/Backend/Module/BaseModule.php index 29101ee4..c31182a4 100644 --- a/Classes/Backend/Module/BaseModule.php +++ b/Classes/Backend/Module/BaseModule.php @@ -83,8 +83,8 @@ abstract class BaseModule extends BaseScriptClass implements IModule /** @var string */ protected $selector; /** @var ServerRequestInterface */ - protected $request = null; - protected $languageTool = null; + protected $request; + protected $languageTool; /** * Initializes the backend module by setting internal variables, initializing the menu. @@ -353,11 +353,10 @@ public function printContent($returnContent = false) if ($returnContent) { return $content; - } else { - echo $content; - - return null; } + echo $content; + + return null; } /** @@ -427,17 +426,16 @@ protected function getFuncMenu() } return $menu; + } + $items = $this->getFuncMenuItems($this->MOD_MENU['function']); + $useTabs = intval($this->getConfigurations()->get('_cfg.funcmenu.useTabs')) > 0; + if ($useTabs) { + $menu = $this->getFormTool()->showTabMenu($this->getPid(), 'function', $this->getName(), $items); } else { - $items = $this->getFuncMenuItems($this->MOD_MENU['function']); - $useTabs = intval($this->getConfigurations()->get('_cfg.funcmenu.useTabs')) > 0; - if ($useTabs) { - $menu = $this->getFormTool()->showTabMenu($this->getPid(), 'function', $this->getName(), $items); - } else { - $menu = $this->getFormTool()->showMenu($this->getPid(), 'function', $this->getName(), $items, $this->getModuleScript()); - } - - return $menu['menu']; + $menu = $this->getFormTool()->showMenu($this->getPid(), 'function', $this->getName(), $items, $this->getModuleScript()); } + + return $menu['menu']; } /** diff --git a/Classes/Backend/Template/ModuleTemplate.php b/Classes/Backend/Template/ModuleTemplate.php index 7eb3d539..99cfdc97 100644 --- a/Classes/Backend/Template/ModuleTemplate.php +++ b/Classes/Backend/Template/ModuleTemplate.php @@ -67,9 +67,9 @@ public function renderContent(ModuleParts $parts) { if (TYPO3::isTYPO121OrHigher()) { return $this->renderContent12($parts); - } else { - return $this->renderContent76($parts); } + + return $this->renderContent76($parts); } public function getPageRenderer() diff --git a/Classes/Configuration/Processor.php b/Classes/Configuration/Processor.php index 4e60118c..db9590f8 100644 --- a/Classes/Configuration/Processor.php +++ b/Classes/Configuration/Processor.php @@ -1108,9 +1108,9 @@ private function getVal(string $key, array $tsArray): array return ['', $currentArray[$segmentWithDot]]; } elseif (isset($currentArray[$segment])) { return [$currentArray[$segment], []]; - } else { - return ['', []]; } + + return ['', []]; } // tiefer steigen, wenn weiterer Pfad existiert diff --git a/Classes/Database/ResultIterator.php b/Classes/Database/ResultIterator.php index 1ca35578..5ca1b67e 100644 --- a/Classes/Database/ResultIterator.php +++ b/Classes/Database/ResultIterator.php @@ -95,10 +95,9 @@ public function count() $row = $result->fetchAssociative(); return (int) array_shift($row); - } else { - $row = $result->fetch(); - - return (int) $row['cnt']; } + $row = $result->fetch(); + + return (int) $row['cnt']; } } diff --git a/Classes/Frontend/Controller/MainController.php b/Classes/Frontend/Controller/MainController.php index 388c1332..cd235e52 100644 --- a/Classes/Frontend/Controller/MainController.php +++ b/Classes/Frontend/Controller/MainController.php @@ -473,9 +473,9 @@ private function _getParameterAction($parameters) $action = $parameters->offsetExists('action') ? $parameters->offsetGet('action') : ''; if (!is_array($action)) { return $action; - } else { - return key($action); } + + return key($action); } /** diff --git a/Classes/Search/SearchBase.php b/Classes/Search/SearchBase.php index a02cb761..22879fe2 100644 --- a/Classes/Search/SearchBase.php +++ b/Classes/Search/SearchBase.php @@ -220,14 +220,13 @@ public function search(array $fields, array $options = []) if ($queryOrBuilder instanceof QueryBuilder) { return $this->countQuery($queryOrBuilder); - } else { - $what = 'COUNT(*) AS cnt'; - $from = '('.$queryOrBuilder.') AS COUNTWRAP'; - $sqlOptions = [ - 'enablefieldsoff' => true, - 'sqlonly' => empty($options['sqlonly']) ? 0 : $options['sqlonly'], - ]; } + $what = 'COUNT(*) AS cnt'; + $from = '('.$queryOrBuilder.') AS COUNTWRAP'; + $sqlOptions = [ + 'enablefieldsoff' => true, + 'sqlonly' => empty($options['sqlonly']) ? 0 : $options['sqlonly'], + ]; } $result = $this->getDatabaseConnection()->doSelect( $what, diff --git a/Classes/Utility/Arrays.php b/Classes/Utility/Arrays.php index 01673d23..d789d111 100644 --- a/Classes/Utility/Arrays.php +++ b/Classes/Utility/Arrays.php @@ -163,7 +163,7 @@ public static function removeNotIn(array $data, array $needle) } /** - * @see \TYPO3\CMS\Core\Utility\ArrayUtility::arrayDiffAssocRecursive() + * @see ArrayUtility::arrayDiffAssocRecursive() */ public static function arrayDiffAssocRecursive(array $array1, array $array2) { diff --git a/Classes/Utility/Misc.php b/Classes/Utility/Misc.php index 4ce0404d..cb754e6f 100644 --- a/Classes/Utility/Misc.php +++ b/Classes/Utility/Misc.php @@ -266,9 +266,8 @@ public static function mayday($msg, $extKey = '') $dieOnMayday = (int) ConfigurationProcessor::getExtensionCfgValue('rn_base', 'dieOnMayday'); if ($dieOnMayday) { exit($sPage); - } else { - echo $sPage; } + echo $sPage; } /** @@ -738,9 +737,8 @@ public static function sendErrorMail($mailAddr, $actionName, Throwable $e, array $lock = Lock::getInstance('errormail', 60); if ($lock->isLocked()) { return; - } else { - $lock->lockProcess(); } + $lock->lockProcess(); } else { $lock = null; } diff --git a/Classes/Utility/Spyc.php b/Classes/Utility/Spyc.php index 5e90cc86..6739250b 100644 --- a/Classes/Utility/Spyc.php +++ b/Classes/Utility/Spyc.php @@ -215,9 +215,9 @@ private function _yamlizeArray($array, $indent) } return $string; - } else { - return false; } + + return false; } /** diff --git a/Classes/Utility/TYPO3.php b/Classes/Utility/TYPO3.php index 49253696..0ba44a77 100644 --- a/Classes/Utility/TYPO3.php +++ b/Classes/Utility/TYPO3.php @@ -200,9 +200,9 @@ private static function findTYPO3Version(): string $t3version = tx_rnbase::makeInstance('TYPO3\CMS\Core\Information\Typo3Version'); return $t3version->getVersion(); - } else { - return TYPO3_version; } + + return TYPO3_version; } /** diff --git a/Classes/Utility/XmlElement.php b/Classes/Utility/XmlElement.php index 5f665915..9312e079 100644 --- a/Classes/Utility/XmlElement.php +++ b/Classes/Utility/XmlElement.php @@ -228,13 +228,12 @@ public function addCData($value, $key = null) $node = $this->addChild($key); return $node->addCData($value); - } else { - $node = dom_import_simplexml($this); - $no = $node->ownerDocument; - $node->appendChild($no->createCDATASection($value)); - - return $this; } + $node = dom_import_simplexml($this); + $no = $node->ownerDocument; + $node->appendChild($no->createCDATASection($value)); + + return $this; } /** From 1dea0f3aff820ca53dcf18c367ecad238711e7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nitzsche?= Date: Fri, 22 May 2026 14:25:58 +0200 Subject: [PATCH 3/4] Backend module broken in t3 11 #368 * fix pipeline --- .github/workflows/php.yaml | 63 +++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/workflows/php.yaml b/.github/workflows/php.yaml index 9e06c8ef..3b47fd8a 100644 --- a/.github/workflows/php.yaml +++ b/.github/workflows/php.yaml @@ -29,34 +29,41 @@ jobs: - 8.4 php-compatibility: - name: "PHPCompatibility" - runs-on: ubuntu-latest - needs: php-lint - steps: - - name: "Checkout" - uses: actions/checkout@v4 - - name: "Install PHP" - uses: shivammathur/setup-php@v2 - with: - php-version: "8.0" - coverage: none - tools: composer:v2 - - name: Prepare TYPO3 - uses: ./.github/actions/t3prepare - with: - php-version: ${{ matrix.php-version }} - - name: "Run PHP CS with PHPCompatibility rule" - run: "composer test:phpcompat ${{ matrix.php-version }}" - strategy: - fail-fast: false - matrix: - php-version: - - 7.4 - - 8.0 - - 8.1 - - 8.2 - - 8.3 - - 8.4 + name: "PHPCompatibility" + runs-on: ubuntu-latest + needs: php-lint + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Install PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: "8.4" + coverage: none + + - name: "Install PHPCompatibility" + run: | + composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true + composer global require --dev \ + squizlabs/php_codesniffer \ + phpcompatibility/php-compatibility \ + dealerdirect/phpcodesniffer-composer-installer \ + --no-interaction + + - name: "Run PHPCompatibility" + run: | + phpcs \ + --ignore='.Build/*,Resources/*' \ + --standard=PHPCompatibility \ + --runtime-set testVersion ${{ matrix.php-version }} \ + -p \ + Classes Migrations Legacy tests + + strategy: + fail-fast: false + matrix: + php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] code-style: name: Check code style From 844f5e024e088286759df93615af0df05e0a09b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nitzsche?= Date: Fri, 22 May 2026 14:54:52 +0200 Subject: [PATCH 4/4] Fix TCA file type in t3 11 #369 --- Classes/Utility/TSFAL.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Utility/TSFAL.php b/Classes/Utility/TSFAL.php index 0c933e24..7916739b 100644 --- a/Classes/Utility/TSFAL.php +++ b/Classes/Utility/TSFAL.php @@ -21,7 +21,7 @@ /*************************************************************** * Copyright notice * - * (c) 2013-2024 Rene Nitzsche + * (c) 2013-2026 Rene Nitzsche * Contact: rene@system25.de * All rights reserved * @@ -493,7 +493,7 @@ public static function getMediaTCA($ref, $options = []) } $config = []; - if (TYPO3::isTYPO115OrHigher()) { + if (TYPO3::isTYPO121OrHigher()) { $config = [ 'type' => 'file', 'appearance' => $customSettingOverride['appearance'] ?? [],