Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Update database after content block creation #240

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Classes/Command/CreateContentBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use TYPO3\CMS\ContentBlocks\Validation\PageTypeNameValidator;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Package\PackageActivationService;
use TYPO3\CMS\Core\Package\PackageInterface;

class CreateContentBlockCommand extends Command
Expand All @@ -45,6 +46,7 @@ public function __construct(
protected readonly PackageResolver $packageResolver,
protected readonly ContentBlockRegistry $contentBlockRegistry,
protected readonly CacheManager $cacheManager,
protected readonly PackageActivationService $packageActivationService,
) {
parent::__construct();
}
Expand Down Expand Up @@ -215,6 +217,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// @todo Core should define "typoscript" as a system cache
$this->cacheManager->getCache('typoscript')->flush();

// Update database to add new fields
$this->packageActivationService->updateDatabase();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work, as TCA is not recreated yet.


$command = Environment::isComposerMode() ? 'vendor/bin/typo3' : 'typo3/sysext/core/bin/typo3';
$output->writeln($command . ' cache:flush -g system');
$output->writeln($command . ' extension:setup --extension=' . $extension);
Expand Down
Loading