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; } } 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++; 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..3da2fed --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,17 @@ +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 + + StudioMitte\TtaddressCountryRelation\Extending\Domain\Model\Address: + tags: + - name: 'extender.extends' + class: FriendsOfTYPO3\TtAddress\Domain\Model\Address 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 @@ =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' => [ ], 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 @@ -