Project

General

Profile

Actions

Bug #91256

closed

PSR-14 configuration available before fireing AfterPackageActivationEvent

Added by Roman Büchler almost 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2020-05-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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));
    }
}
Actions #1

Updated by Roman Büchler about 3 years ago

The behaviour can't be reproduced with TYPO3 10.4.12. This ticket might be closed.

Actions #2

Updated by Riccardo De Contardi almost 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.

Actions

Also available in: Atom PDF