Fix dependency injection issues in AbstractCRUDController

Replaced incorrect service definitions in AbstractCRUDController to ensure proper dependency injection. Specifically, fixed retrieval of the ManagerRegistry and Validator services to resolve CalendarRange save errors (Issue #362). No schema changes were introduced.
This commit is contained in:
Julien Fastré 2025-03-04 23:02:19 +01:00
parent 350661a4fa
commit 03b2496817
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: Fix Dependency Injection, which prevented to save the CalendarRange
time: 2025-03-04T16:00:58.269626007+01:00
custom:
Issue: "362"
SchemaChange: No schema change

View File

@ -63,7 +63,6 @@ abstract class AbstractCRUDController extends AbstractController
parent::getSubscribedServices(), parent::getSubscribedServices(),
[ [
'chill_main.paginator_factory' => PaginatorFactory::class, 'chill_main.paginator_factory' => PaginatorFactory::class,
ManagerRegistry::class => ManagerRegistry::class,
'translator' => TranslatorInterface::class, 'translator' => TranslatorInterface::class,
AuthorizationHelper::class => AuthorizationHelper::class, AuthorizationHelper::class => AuthorizationHelper::class,
EventDispatcherInterface::class => EventDispatcherInterface::class, EventDispatcherInterface::class => EventDispatcherInterface::class,
@ -213,7 +212,7 @@ abstract class AbstractCRUDController extends AbstractController
protected function getManagerRegistry(): ManagerRegistry protected function getManagerRegistry(): ManagerRegistry
{ {
return $this->container->get(ManagerRegistry::class); return $this->container->get('doctrine');
} }
/** /**
@ -226,7 +225,7 @@ abstract class AbstractCRUDController extends AbstractController
protected function getValidator(): ValidatorInterface protected function getValidator(): ValidatorInterface
{ {
return $this->get('validator'); return $this->container->get('validator');
} }
/** /**