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

Dispatch afterExtensionInstall signal from extension:setupactive #444

Closed
HenningCash opened this issue Mar 15, 2017 · 2 comments
Closed

Comments

@HenningCash
Copy link

As a follow up from #295

Most deployment setups für TYPO3 CMS (including TYPO3 Surf) install extensions via install:generatepackagestates and extension:setupactive.
As a minor flaw this does not emit the TYPO3\CMS\Extensionmanager\Utility\InstallUtility::afterExtensionInstall signal like extension:activate does for each package.

I'm not 100% convinced it's save to trigger the event by default as it would be emitted on every deploy. Maybe there are extensions that use the signal and rely on the "actual" one-time extension install situation. So as a workaround the behaviour could be enabled by passing a flag to the extension:setupactive command:

public function setupActiveCommand($force = FALSE)
{
    $active_packages = $this->packageManager->getActivePackages();
    $this->setupExtensions($active_packages, $force ? array_keys($active_packages) : []);
}

The setupCommand should receive this new flag as well.

On the other hand it could also become the default behaviour... I think all slots using this signal must be idempotent as you can uninstall and reinstall an extension with the extension-manager as well.

@helhum
Copy link
Member

helhum commented Apr 6, 2017

I'm not 100% convinced it's save to trigger the event by default as it would be emitted on every deploy

The event subscribers' code should be idempotent, therefore it should be safe to call this every time. If subscribers are not idempotent I would consider this a bug within the subscribers.

Therefore I will change to code to always emit this signal

helhum added a commit that referenced this issue Apr 6, 2017
The event subscribers' code must be idempotent, therefore
it save safe to emit this event every time setup is called

Fixes #444
@HenningCash
Copy link
Author

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants