From 5e7ddee316e9f6c44a893e5d5fe28307d802ef80 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Wed, 5 Aug 2026 11:05:36 +0200 Subject: [PATCH 1/3] [TASK] Update composer dependencies --- composer.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index eaa57c1..ed1cc2d 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,9 @@ "typo3/class-alias-loader": true, "sbuerk/typo3-cmscomposerinstallers-testingframework-bridge": true, "phpstan/extension-installer": true - } + }, + "lock": false, + "sort-packages": true }, "extra": { "typo3/cms": { @@ -48,13 +50,10 @@ "web-dir": ".build/public" } }, - "version": "8.0.0", - "minimum-stability": "dev", - "prefer-stable": true, "require": { "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "ext-pdo": "*", - "extcode/cart": "dev-main as 12.0.0", + "extcode/cart": "^12.0", "typo3/cms-core": "^14.3", "typo3/cms-extbase": "^14.3", "typo3/cms-fluid": "^14.3" From 97bc43452084860274b6b232a662c590b267a00e Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Sun, 9 Aug 2026 11:13:56 +0200 Subject: [PATCH 2/3] [BUGFIX] Apply changes for cgl and phpstan Use own extcode/testing-framework extension as the typo3/testing-framework removes the codeception support for acceptance tests. --- .../Domain/Repository/CategoryRepository.php | 3 + Classes/Hooks/DataHandler.php | 1 + Configuration/Services.php | 2 - Tests/Acceptance/Support/Environment.php | 2 +- Tests/Acceptance/Support/Tester.php | 3 - composer.json | 2 +- ext_localconf.php | 198 ++++++++++-------- 7 files changed, 115 insertions(+), 96 deletions(-) diff --git a/Classes/Domain/Repository/CategoryRepository.php b/Classes/Domain/Repository/CategoryRepository.php index b1b5e3d..2e45480 100644 --- a/Classes/Domain/Repository/CategoryRepository.php +++ b/Classes/Domain/Repository/CategoryRepository.php @@ -28,6 +28,9 @@ public function findAllAsArray(?Category $selectedCategory = null): array $categories = []; // Transform categories to array foreach ($localCategories as $localCategory) { + if (($localCategory instanceof Category) === false) { + continue; + } $newCategory = [ 'uid' => $localCategory->getUid(), 'title' => $localCategory->getTitle(), diff --git a/Classes/Hooks/DataHandler.php b/Classes/Hooks/DataHandler.php index 54add3e..b0c151b 100644 --- a/Classes/Hooks/DataHandler.php +++ b/Classes/Hooks/DataHandler.php @@ -14,6 +14,7 @@ class DataHandler { public function __construct(private readonly CacheManager $cacheManager) {} + /** * Flushes the cache if a news record was edited. * This happens on two levels: by UID and by PID. diff --git a/Configuration/Services.php b/Configuration/Services.php index 0e32bd6..f00568f 100644 --- a/Configuration/Services.php +++ b/Configuration/Services.php @@ -2,8 +2,6 @@ declare(strict_types=1); -namespace Extcode\CartProducts\Configuration; - use Extcode\CartProducts\Handler\WatchlistItemHandler; use Extcode\CartProducts\Hooks\DataHandler; use Extcode\CartProducts\Reaction\UpdateStockReaction; diff --git a/Tests/Acceptance/Support/Environment.php b/Tests/Acceptance/Support/Environment.php index 1ef7acb..b9eb905 100644 --- a/Tests/Acceptance/Support/Environment.php +++ b/Tests/Acceptance/Support/Environment.php @@ -13,7 +13,7 @@ use Codappix\Typo3PhpDatasets\PhpDataSet; use Codeception\Event\SuiteEvent; -use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment; +use Extcode\TestingFramework\Core\Acceptance\Extension\BackendEnvironment; final class Environment extends BackendEnvironment { diff --git a/Tests/Acceptance/Support/Tester.php b/Tests/Acceptance/Support/Tester.php index e353ed3..22db3a1 100644 --- a/Tests/Acceptance/Support/Tester.php +++ b/Tests/Acceptance/Support/Tester.php @@ -13,7 +13,6 @@ use Codeception\Actor; use Extcode\CartProducts\Tests\Acceptance\Support\_generated\TesterActions; -use TYPO3\TestingFramework\Core\Acceptance\Step\FrameSteps; /** * @method void wantToTest($text) @@ -31,7 +30,5 @@ class Tester extends Actor { use TesterActions; - use FrameSteps; - protected int $retryNum = 2; } diff --git a/composer.json b/composer.json index ed1cc2d..a17b60a 100644 --- a/composer.json +++ b/composer.json @@ -63,6 +63,7 @@ "codeception/codeception": "^5.0", "codeception/module-db": "^3.1", "codeception/module-webdriver": "^4.0", + "extcode/testing-framework": "dev-main", "friendsofphp/php-cs-fixer": "^3.64", "helmich/typo3-typoscript-lint": "^3.1", "phpstan/extension-installer": "^1.4", @@ -75,7 +76,6 @@ "typo3/cms-fluid-styled-content": "^14.3", "typo3/cms-install": "^14.3", "typo3/cms-reactions": "^14.3", - "typo3/testing-framework": "^9.3", "werkraummedia/watchlist": "^3.0", "ssch/typo3-rector": "^3.11" }, diff --git a/ext_localconf.php b/ext_localconf.php index 10d4af6..ce59193 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -5,94 +5,114 @@ use Extcode\CartProducts\Controller\ProductController; use Extcode\CartProducts\Hooks\DataHandler; use Extcode\CartProducts\Hooks\DatamapDataHandlerHook; -use TYPO3\CMS\Extbase\Domain\Model\Category; +use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility; -$_LLL_be = 'LLL:EXT:cart_products/Resources/Private/Language/locallang_be.xlf:'; - -// configure plugins -ExtensionUtility::configurePlugin( - 'cart_products', - 'ShowProduct', - [ - ProductController::class => 'show, showForm', - ], - [ - ProductController::class => 'showForm', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'cart_products', - 'ListProducts', - [ - ProductController::class => 'list, show, showForm', - ], - [ - ProductController::class => 'showForm', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'cart_products', - 'TeaserProducts', - [ - ProductController::class => 'teaser, showForm', - ], - [ - ProductController::class => 'showForm', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'cart_products', - 'SingleProduct', - [ - ProductController::class => 'show, showForm', - ], - [ - ProductController::class => 'showForm', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'cart_products', - 'ProductPartial', - [ - ProductController::class => 'showForm', - ], - [ - ProductController::class => 'showForm', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -// Cart Hooks - -// processDatamapClass Hook - -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['cartproducts_allowed'] - = DatamapDataHandlerHook::class; - -// clearCachePostProc Hook - -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['cartproducts_clearcache'] - = DataHandler::class . '->clearCachePostProc'; - -// register "cartproducts:" namespace -$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['cartproducts'][] - = 'Extcode\\CartProducts\\ViewHelpers'; - -// register listTemplateLayouts -$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['list_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.table', 'table']; -$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['list_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.grid', 'grid']; -$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['teaser_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.table', 'table']; -$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['teaser_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.grid', 'grid']; - -$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][Category::class] = [ - 'className' => \Extcode\CartProducts\Domain\Model\Category::class, -]; +(static function (string $extKey): void { + $_LLL_be = 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_be.xlf:'; + + if (is_array($GLOBALS['TYPO3_CONF_VARS'] ?? null) === false) { + throw new \Exception('$GLOBALS[\'TYPO3_CONF_VARS\'] is not an array', 1774601240); + } + + ArrayUtility::mergeRecursiveWithOverrule( + $GLOBALS['TYPO3_CONF_VARS'], + [ + 'EXT' => [ + $extKey => [ + 'templateLayouts' => [ + 'list_products' => [ + 'table' => [$_LLL_be . 'flexforms_template.templateLayout.table', 'table'], + 'grid' => [$_LLL_be . 'flexforms_template.templateLayout.grid', 'grid'], + ], + 'teaser_products' => [ + 'table' => [$_LLL_be . 'flexforms_template.templateLayout.table', 'table'], + 'grid' => [$_LLL_be . 'flexforms_template.templateLayout.grid', 'grid'], + ], + ], + ], + ], + 'SC_OPTIONS' => [ + 't3lib/class.t3lib_tcemain.php' => [ + 'processDatamapClass' => [ + 'cartproducts_allowed' => DatamapDataHandlerHook::class, + ], + 'clearCachePostProc' => [ + 'cartproducts_clearcache' => DataHandler::class . '->clearCachePostProc', + ], + ], + ], + 'SYS' => [ + 'fluid' => [ + 'namespaces' => [ + 'cartproducts' => [ + 1 => 'Extcode\\CartProducts\\ViewHelpers', + ], + ], + ], + ], + ] + ); + + // configure plugins + ExtensionUtility::configurePlugin( + 'cart_products', + 'ShowProduct', + [ + ProductController::class => 'show, showForm', + ], + [ + ProductController::class => 'showForm', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'cart_products', + 'ListProducts', + [ + ProductController::class => 'list, show, showForm', + ], + [ + ProductController::class => 'showForm', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'cart_products', + 'TeaserProducts', + [ + ProductController::class => 'teaser, showForm', + ], + [ + ProductController::class => 'showForm', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'cart_products', + 'SingleProduct', + [ + ProductController::class => 'show, showForm', + ], + [ + ProductController::class => 'showForm', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'cart_products', + 'ProductPartial', + [ + ProductController::class => 'showForm', + ], + [ + ProductController::class => 'showForm', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + +})('cart_products'); From bd4b860c51851e854609b2582869b13ad59cd8d2 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Sun, 9 Aug 2026 11:25:37 +0200 Subject: [PATCH 3/3] [BUGFIX] Use stable nixos version and cacert package The obviously removed cacert oackage in newer nixos actions throws an error when pulling a composer dependency from other sources using a Let's Encrypt certificate. --- .github/workflows/ci.yaml | 2 +- shell.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89e8fb9..c0eb173 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -134,7 +134,7 @@ jobs: - uses: cachix/install-nix-action@v31 with: - nix_path: nixpkgs=channel:nixos-unstable + nix_path: nixpkgs=channel:nixos-26.05 - name: Run Acceptance Tests PHP8.2 run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-acceptance diff --git a/shell.nix b/shell.nix index 0b95c18..11ed21e 100644 --- a/shell.nix +++ b/shell.nix @@ -148,6 +148,7 @@ let in pkgs.mkShellNoCC { name = "TYPO3 Extension extcode/cart-products"; buildInputs = [ + pkgs.cacert php composer projectInstall