#91256PSR-14 configuration available before fireing AfterPackageActivationEvent
Description
The use case is an extension changing the site’s branding (e.g. be login screen).
With TYPO3 V9 a signal could have been setup for that purpose:
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
'afterExtensionInstall',
\Buepro\Pizpalue\Service\BrandingService::class,
'setBackendStyling'
);
When trying to achieve the same with an event it doesn’t work because the configuration defined in Configuration/Services.yaml isn’t available. The configuration looks as following:
services:
_defaults:
autowire: true
autoconfigure: true
public: false
Buepro\Pizpalue\:
resource: '../Classes/*'
Buepro\Pizpalue\Service\BrandingService:
tags:
- name: event.listener
identifier: 'pizpalue-branding'
method: 'handlePackageActivationEvent'
event: TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent
Could the InstallUtility be adjusted in the following way:
public function install(...$extensionKeys)
{
...
$this->reloadCaches();
$this->updateDatabase();
// Read in PSR-14 configuration
...
foreach ($extensionKeys as $extensionKey) {
$this->processExtensionSetup($extensionKey);
$this->eventDispatcher->dispatch(new AfterPackageActivationEvent($extensionKey, 'typo3-cms-extension', $this));
}
}Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.