Review main Merged

62425[BUGFIX] Provide global Symfony container instance in upgrade wizards

Benjamin Franzke CR +2 V +2 Normal +38 −18 updated 11/29/19, 06:47

Commit message

Upgrade wizars may contain legacy code that requires services
using makeInstance. As makeInstance needs to use the PSR-11 container
for services that require dependency injection, we need to provide
the global container intance during upgrade wizard execution.

Also ensure that only *one* (singleton) PackageManager instance is used:
ProviderConfigurationLoader used to create a second PackageManager
instance. It passed a constructor argument which caused GU::makeInstance
to bypass the symfony (PSR-11) container and to create a new instance
(on its own). This new instance was then cached as singleton instance and
all subsequent makeInstance calls returned this instance instead of the
global instance. Therefore we now ensure that new singleton instances
will not be cached if the singleton is known by the PSR-11 container.
This inconsistency caused the Typo3DbExtractionUpdate to fail because
some codepaths used one PackageManager instance (through DI) and some
codepaths another instance (through makeInstance).

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 7