Review main Merged

93688[BUGFIX] Dispatch `AfterPackageActivationEvent` on package activation again

Helmut Hummel CR +2 V +2 Normal +130 −18 updated 04/20/26, 18:10

Commit message

A previous refactoring of `PackageSetup` unintentionally stopped
dispatching `AfterPackageActivationEvent`.

The old implementation relied on listeners inspecting the container
from `PackageInitializationEvent` to detect whether initialization was
triggered during package activation. This no longer worked after the
refactoring, because the container was not passed.

To restore the previous behavior, `PackageInitializationEvent` now
explicitly carries whether the current initialization happens as part
of a package activation. The listener
`DispatchAfterPackageActivationEventOnPackageInitialization` uses this
new flag to decide whether to dispatch
`AfterPackageActivationEvent`.

At the same time, `PackageSetup` now receives the
`EventDispatcherInterface` via constructor injection. Since
`PackageActivationService` creates `PackageSetup` from the rebuilt
container, the dispatcher and its listeners automatically belong to the
correct container state.

For backwards compatibility, `PackageInitializationEvent` still exposes
the container and emitter for now. These accessors are marked for
future deprecation.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Stefan Froemken +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Stefan Froemken +1
    • core-ci +1 CI

Issues 2

Files 11

Review log 2839

Show 814 earlier messages
  1. Helmut Hummel uploaded patch set 1 04/16/26, 11:32

  2. Helmut Hummel updated the commit message in patch set 2 04/16/26, 11:33

  3. core-ci voted on patch set 1 V -1 04/16/26, 11:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100310

  4. core-ci voted on patch set 2 V -1 04/16/26, 11:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100311

  5. Helmut Hummel rebased onto patch set 3 V -1 04/17/26, 13:13

  6. Helmut Hummel uploaded patch set 4 04/17/26, 13:18

  7. core-ci voted on patch set 3 V -1 04/17/26, 13:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100383

  8. core-ci voted on patch set 4 V -1 04/17/26, 13:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100385

  9. Christian Kuhn uploaded patch set 5 V -1 04/17/26, 15:45

  10. Oliver Klee updated the commit message in patch set 6 04/17/26, 15:46

  11. Oliver Klee voted on patch set 6 CR +1 04/17/26, 15:47

  12. core-ci voted on patch set 5 V +1 04/17/26, 15:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100396

  13. core-ci voted on patch set 6 V +1 04/17/26, 15:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100397

  14. Christian Kuhn commented on patch set 6 04/17/26, 16:01

    PackageInitializationEvent.php:51

    thikn we need a deprecation.rst for this one since the event has been documented as feature in 13.0
  1. Helmut Hummel uploaded patch set 7 CR +1 V +1 04/17/26, 18:03

  2. Helmut Hummel uploaded patch set 8 04/17/26, 18:05

  3. core-ci voted on patch set 7 V -1 04/17/26, 18:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100408

  4. core-ci voted on patch set 8 V +1 04/17/26, 18:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100411

  5. Helmut Hummel uploaded patch set 9 V +1 04/20/26, 07:13

  6. Helmut Hummel commented on patch set 9 04/20/26, 07:14

    PackageInitializationEvent.php:51 Reply

    postponed the deprecation as it is less important than the actual fix
  7. core-ci voted on patch set 9 V -1 04/20/26, 07:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100517

  8. Benjamin Kott commented on patch set 9 04/20/26, 09:52

    did not see this patch, until it showed merge conflicts, just wanted to provide a quick fix and test for the issue, pick what you like best 93744: [BUGFIX] Dump class loading information on extension install | https://review.typo3.org/c/Packages/TYPO3.CMS/+/93744
  9. Helmut Hummel commented on patch set 9 04/20/26, 10:13

    Reply

    Thanks will pick up your tests, but go with my implementation, as it goes a bit beyond the actual fix
  10. Helmut Hummel commented on patch set 9 04/20/26, 10:17

    Reply

    Actually, I will skip your test, but add a different one, as yours tests a lot of implementation details
  11. Helmut Hummel uploaded patch set 10 V -1 04/20/26, 10:47

  12. core-ci voted on patch set 10 V +1 04/20/26, 10:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100545

  13. Oliver Klee voted on patch set 10 V +1 04/20/26, 11:02

  14. Benni Mack voted on patch set 10 CR +1 V +1 04/20/26, 12:21

  15. Christian Kuhn commented on patch set 10 04/20/26, 12:53

    DispatchAfterPackageActivationEventOnPackageInitialization.php:32

    nit.
  16. Helmut Hummel commented on patch set 10 04/20/26, 13:15

    DispatchAfterPackageActivationEventOnPackageInitialization.php:32 Reply

    darn...
  17. Helmut Hummel commented on patch set 10 04/20/26, 13:15

    DispatchAfterPackageActivationEventOnPackageInitialization.php:32 Reply

    Done
  18. Helmut Hummel uploaded patch set 11 CR +1 V +1 04/20/26, 13:16

  19. core-ci voted on patch set 11 V +1 04/20/26, 13:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100565

  20. Oliver Klee voted on patch set 11 V +1 04/20/26, 13:33

  21. Stefan Bürk voted on patch set 11 V +1 04/20/26, 17:31

  22. Stefan Bürk voted on patch set 11 CR +1 04/20/26, 17:33

  23. Stefan Froemken commented on patch set 11 CR +1 V +1 04/20/26, 17:36

    Thank you Helmut. IMO a patch which definitely was to become part of the release tomorrow. I had that problem this morning and Core told me to create an issue at news. But I wondered, because I could not install any extension with PHP classes. I just stumbled over your patch and installing extensions is possible again. Nice. +1 and validated.

    PackageSetup.php:54

    Nice to have: Multiline
  24. Stefan Bürk commented on patch set 11 CR +2 V +2 04/20/26, 18:10

    PackageSetup.php:54 Reply

    Let's do that as a follow-up.
  25. Stefan Bürk merged patch set 12 04/20/26, 18:10