diff --git a/common/oatbox/service/ServiceManager.php b/common/oatbox/service/ServiceManager.php index 5d3a414a4..062fd08ae 100644 --- a/common/oatbox/service/ServiceManager.php +++ b/common/oatbox/service/ServiceManager.php @@ -267,7 +267,11 @@ public function getContainer(): ContainerInterface public function rebuildContainer(): void { + // if container was already built on same request, it has to be restarted before rebuild + // to avoid fatal error of compiled container modification + $this->containerStarter = null; $this->getContainerStarter()->getContainerBuilder()->forceBuild(); + // after container rebuild this cached starter needs a reset, to avoid using container already cached in memory $this->containerStarter = null; }