From e3544f4ade3c5cc75eb1668101aca4c8465ce877 Mon Sep 17 00:00:00 2001 From: Karsten Nowak Date: Tue, 30 Jul 2024 12:32:54 +0200 Subject: [PATCH] [TASK] Update reference index after changing test data Related #1120 --- Classes/Command/CreateTestDataCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/Command/CreateTestDataCommand.php b/Classes/Command/CreateTestDataCommand.php index f6ef35f..d7d0173 100644 --- a/Classes/Command/CreateTestDataCommand.php +++ b/Classes/Command/CreateTestDataCommand.php @@ -4,13 +4,19 @@ declare(strict_types=1); namespace TTN\Tea\Command; +use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use TYPO3\CMS\Backend\Command\ProgressListener\ReferenceIndexProgressListener; +use TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand; +use TYPO3\CMS\Core\Core\Bootstrap; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Database\ReferenceIndex; use TYPO3\CMS\Core\Utility\GeneralUtility; /* @@ -76,6 +82,10 @@ final class CreateTestDataCommand extends Command } $output->writeln(sprintf('Test data in page %s created.', $pageUid)); + $referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class); + $referenceIndex->updateIndex(0); + $output->writeln('Reference index updated.'); + return Command::SUCCESS; } }