Bug #91256
closedPSR-14 configuration available before fireing AfterPackageActivationEvent
0%
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));
}
}
Updated by Roman Büchler over 3 years ago
The behaviour can't be reproduced with TYPO3 10.4.12. This ticket might be closed.
Updated by Riccardo De Contardi over 2 years ago
- Status changed from New to Closed
@Roman Büchler Thank you for your feedback and sorry for the very very late reply;
I close this issue in agreement with the reporter.
If you think that this is the wrong decision or I have misunderstood or there is still work to be done, please reopen it or open a new issue with a reference to this one.
Thank you.