From b41713c0b82e9382a17b7df6cf1c011d132d30e4 Mon Sep 17 00:00:00 2001 From: Christoph Schwob Date: Tue, 30 Jul 2024 22:19:29 +0200 Subject: [PATCH 1/6] [TASK] allow TYPO3 12 and update other dependencies --- composer.json | 8 ++++---- ext_emconf.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 3931440..de2c69c 100755 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ ], "license": "GPL-2.0-or-later", "require": { - "typo3/cms-core": "^11.0", + "typo3/cms-core": "^11.0 || ^12.4", "php": ">=7.4", - "friendsoftypo3/tt-address": "^5.3 || ^6", - "evoweb/extender": "^8.1", - "sjbr/static-info-tables": "^11.5" + "friendsoftypo3/tt-address": "^5.3 || ^6 || ^7 || ^8 || ^9", + "evoweb/extender": "^10.1", + "sjbr/static-info-tables": "^11.5 || ^12.4" }, "extra": { "typo3/cms": { diff --git a/ext_emconf.php b/ext_emconf.php index 430e6d9..57f5cc7 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -13,10 +13,10 @@ 'version' => '2.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-11.5.99', - 'tt_address' => '5.3.0-6.99.99', - 'static_info_tables' => '11.5.1-11.5.99', - 'extender' => '8.1.0-8.9.99', + 'typo3' => '11.5.0-12.4.99', + 'tt_address' => '5.3.0-9.99.99', + 'static_info_tables' => '11.5.1-12.4.99', + 'extender' => '10.1.0-10.99.99', ], 'conflicts' => [ ], From 8d4be4cad868611323fe1f7a25499bc184209538 Mon Sep 17 00:00:00 2001 From: Christoph Schwob Date: Tue, 30 Jul 2024 22:20:11 +0200 Subject: [PATCH 2/6] [TASK] check for TYPO3 instead of TYPO3_MODE --- Configuration/TCA/Overrides/tt_address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/TCA/Overrides/tt_address.php b/Configuration/TCA/Overrides/tt_address.php index 9afb5cf..a5ebdb0 100644 --- a/Configuration/TCA/Overrides/tt_address.php +++ b/Configuration/TCA/Overrides/tt_address.php @@ -1,7 +1,7 @@ Date: Tue, 30 Jul 2024 22:22:20 +0200 Subject: [PATCH 3/6] [TASK] migrate command registry (Deprecation: #89139) --- Configuration/Commands.php | 15 --------------- Configuration/Services.yaml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 Configuration/Commands.php create mode 100644 Configuration/Services.yaml diff --git a/Configuration/Commands.php b/Configuration/Commands.php deleted file mode 100644 index e637c46..0000000 --- a/Configuration/Commands.php +++ /dev/null @@ -1,15 +0,0 @@ - [ - 'class' => \StudioMitte\TtaddressCountryRelation\Command\CountryNameMigrationCommand::class, - 'schedulable' => false, - ], -]; diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml new file mode 100644 index 0000000..012bce2 --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,12 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + StudioMitte\TtaddressCountryRelation\Command\CountryNameMigrationCommand: + tags: + - name: 'console.command' + command: 'ttaddress_country_relation:migrate' + description: 'Migrate tt_address country field' + schedulable: false From 40b87eaf2b84dfc210ee83fa45c9d92818f490d8 Mon Sep 17 00:00:00 2001 From: Christoph Schwob Date: Tue, 30 Jul 2024 22:22:42 +0200 Subject: [PATCH 4/6] [TASK] refactor console command --- Classes/Command/CountryNameMigrationCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Command/CountryNameMigrationCommand.php b/Classes/Command/CountryNameMigrationCommand.php index cb9da87..7d06da1 100644 --- a/Classes/Command/CountryNameMigrationCommand.php +++ b/Classes/Command/CountryNameMigrationCommand.php @@ -25,7 +25,7 @@ protected function configure(): void /** * @inheritdoc */ - protected function execute(InputInterface $input, OutputInterface $output): void + protected function execute(InputInterface $input, OutputInterface $output): int { $service = GeneralUtility::makeInstance(MigrationService::class); $count = $service->run(); @@ -33,5 +33,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void $io = new SymfonyStyle($input, $output); $io->title($this->getDescription()); $io->success(sprintf('Migrated %s records!', $count)); + + return Command::SUCCESS; } } From 56fa99d6e47143512fec84aa0f520ae1a9b0f3b2 Mon Sep 17 00:00:00 2001 From: Christoph Schwob Date: Tue, 30 Jul 2024 22:23:16 +0200 Subject: [PATCH 5/6] [TASK] update configs for ext:extender --- Configuration/Services.yaml | 5 +++++ ext_localconf.php | 14 -------------- 2 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 ext_localconf.php diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 012bce2..3da2fed 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -10,3 +10,8 @@ services: command: 'ttaddress_country_relation:migrate' description: 'Migrate tt_address country field' schedulable: false + + StudioMitte\TtaddressCountryRelation\Extending\Domain\Model\Address: + tags: + - name: 'extender.extends' + class: FriendsOfTYPO3\TtAddress\Domain\Model\Address diff --git a/ext_localconf.php b/ext_localconf.php deleted file mode 100644 index 75174ba..0000000 --- a/ext_localconf.php +++ /dev/null @@ -1,14 +0,0 @@ - Date: Tue, 30 Jul 2024 23:09:21 +0200 Subject: [PATCH 6/6] [TASK] remove hidden, start and endtime restriction --- Classes/Migration/MigrationService.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Classes/Migration/MigrationService.php b/Classes/Migration/MigrationService.php index db23e0b..10d781b 100644 --- a/Classes/Migration/MigrationService.php +++ b/Classes/Migration/MigrationService.php @@ -5,6 +5,9 @@ namespace StudioMitte\TtaddressCountryRelation\Migration; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction; +use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; +use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction; use TYPO3\CMS\Core\Utility\GeneralUtility; class MigrationService @@ -14,6 +17,11 @@ public function run(): int $count = 0; $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_address'); + $queryBuilder->getRestrictions() + ->removeByType(HiddenRestriction::class) + ->removeByType(StartTimeRestriction::class) + ->removeByType(EndTimeRestriction::class); + $rows = $queryBuilder ->select('uid', 'country') ->from('tt_address') @@ -23,6 +31,7 @@ public function run(): int ) ->execute() ->fetchAll(); + foreach ($rows as $row) { if ($this->updateSingleRow($row['country'], $row['uid'])) { $count++;