Skip to content
Snippets Groups Projects

Issue #3260669: automatic_updates_9_3_shim should add update_hook_registry service

Merged Issue #3260669: automatic_updates_9_3_shim should add update_hook_registry service
1 unresolved thread
Merged Adam G-H requested to merge issue/automatic_updates-3260669:3260669-shim-92 into 8.x-2.x
1 unresolved thread
3 files
+ 199
9
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -4,6 +4,7 @@ namespace Drupal\automatic_updates_9_3_shim;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Symfony\Component\DependencyInjection\Reference;
/**
* Modifies container service definitions.
@@ -16,9 +17,29 @@ class AutomaticUpdates93ShimServiceProvider extends ServiceProviderBase {
public function alter(ContainerBuilder $container) {
parent::alter($container);
$service_id = 'update.update_hook_registry_factory';
if ($container->hasDefinition($service_id)) {
$container->getDefinition($service_id)
->setClass(UpdateHookRegistryFactory::class);
}
else {
$container->register($service_id, UpdateHookRegistryFactory::class)
->addMethodCall('setContainer', [
new Reference('service_container'),
]);
}
$service_id = 'update.update_hook_registry';
if (!$container->hasDefinition($service_id)) {
$container->register($service_id, UpdateHookRegistry::class);
if ($container->hasDefinition($service_id)) {
$container->getDefinition($service_id)
->setClass(UpdateHookRegistry::class);
}
else {
$container->register($service_id, UpdateHookRegistry::class)
->setFactory([
new Reference($service_id . '_factory'),
'create',
]);
}
}
Loading