diff --git a/library/Zend/Mvc/Service/ServiceManagerConfig.php b/library/Zend/Mvc/Service/ServiceManagerConfig.php index 614310112be..2514bf2153c 100644 --- a/library/Zend/Mvc/Service/ServiceManagerConfig.php +++ b/library/Zend/Mvc/Service/ServiceManagerConfig.php @@ -130,10 +130,14 @@ public function configureServiceManager(ServiceManager $serviceManager) } $serviceManager->addInitializer(function ($instance) use ($serviceManager) { - if ($instance instanceof EventManagerAwareInterface - && !$instance->getEventManager() instanceof EventManagerInterface - ) { - $instance->setEventManager($serviceManager->get('EventManager')); + if ($instance instanceof EventManagerAwareInterface) { + if ($instance->getEventManager() instanceof EventManagerInterface) { + $instance->getEventManager()->setSharedManager( + $serviceManager->get('SharedEventManager') + ); + } else { + $instance->setEventManager($serviceManager->get('EventManager')); + } } });