Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Zend\Navigation\Service\ConstructedNavigationFactory not inject dependences (router, action and etc) #3898

Closed
alexshelkov opened this Issue · 1 comment

2 participants

@alexshelkov

Test code:

$factory = new ConstructedNavigationFactory($pages);
$factory->createService($sm); //$sm is just application service manager, and it have all dependeces

This code throw an exception. But if I correct Zend\Navigation\Service\ConstructedNavigationFactory everything start working:

public function getPages(ServiceLocatorInterface $serviceLocator)
    {
        $application = $serviceLocator->get('Application'); // added
        $routeMatch = $application->getMvcEvent()->getRouteMatch(); // added
        $router = $application->getMvcEvent()->getRouter(); // added

        $this->pages = $this->injectComponents($this->pages, $routeMatch, $router); // added

        return $this->pages;
    }
@froschdesign

Duplicates #2898

@ghost Unknown referenced this issue from a commit
@weierophinney weierophinney Merge branch 'hotfix/4063'
Close #4063
Fixes #2898
Fixes #3898
543d417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.