Skip to content

Commit

Permalink
[BUGFIX] Inject logger into YamlFileLoader
Browse files Browse the repository at this point in the history
YamlFileLoader needs to be instantiated via `self::new` to
ensure that a logger instance is injected.

The issues was introduced with #103187 where YamlFileLoader was added to
be provided by the EXT:install ServiceProvider. This is actually not
quite right, as a service is always to be provided by the extension that
ships the service, not by the consumer.

Therefore the YamlFileLoader service definition is now moved into
EXT:core.

Resolves: #103444
Related: #103187
Releases: main
Change-Id: Ifa3b690a43239c26903443789f59fcd2768fd9d5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83553
Tested-by: core-ci <typo3@b13.com>
Tested-by: Andreas Kienast <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Kienast <a.fernandez@scripting-base.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
bnf committed Mar 21, 2024
1 parent 85b00d0 commit 0c8317c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions typo3/sysext/core/Classes/ServiceProvider.php
Expand Up @@ -58,6 +58,7 @@ public function getFactories(): array
Database\ConnectionPool::class => self::getConnectionPool(...),
Database\DriverMiddlewareService::class => self::getDriverMiddlewaresService(...),
Charset\CharsetConverter::class => self::getCharsetConverter(...),
Configuration\Loader\YamlFileLoader::class => self::getYamlFileLoader(...),
Configuration\SiteConfiguration::class => self::getSiteConfiguration(...),
Command\ListCommand::class => self::getListCommand(...),
HelpCommand::class => self::getHelpCommand(...),
Expand Down Expand Up @@ -178,6 +179,11 @@ public static function getCharsetConverter(ContainerInterface $container): Chars
return self::new($container, Charset\CharsetConverter::class);
}

public static function getYamlFileLoader(ContainerInterface $container): Configuration\Loader\YamlFileLoader
{
return self::new($container, Configuration\Loader\YamlFileLoader::class);
}

public static function getSiteConfiguration(ContainerInterface $container): Configuration\SiteConfiguration
{
return self::new($container, Configuration\SiteConfiguration::class, [
Expand Down
6 changes: 0 additions & 6 deletions typo3/sysext/install/Classes/ServiceProvider.php
Expand Up @@ -109,7 +109,6 @@ public function getFactories(): array
Database\PermissionsCheck::class => self::getPermissionsCheck(...),
Mailer::class => self::getMailer(...),
Updates\DatabaseUpdatedPrerequisite::class => self::getDatabaseUpdatedPrerequisite(...),
YamlFileLoader::class => self::getYamlFileLoader(...),
];
}

Expand Down Expand Up @@ -437,11 +436,6 @@ public static function getDatabaseUpdatedPrerequisite(ContainerInterface $contai
]);
}

public static function getYamlFileLoader(ContainerInterface $container): YamlFileLoader
{
return new YamlFileLoader();
}

public static function configureCommands(ContainerInterface $container, CommandRegistry $commandRegistry): CommandRegistry
{
$commandRegistry->addLazyCommand(
Expand Down

0 comments on commit 0c8317c

Please sign in to comment.