ZF-6579: Zend_Controller_Router_Route_Module::getInstance() doesnt add dispatcher and request to the route.

Description

After try to set a new default route with chaining in the configuration file, after discussion with DASPRiD, He found that the getInstance() doesnt add the dispatcher.

Here is what I add in the method to get it work.

public static function getInstance(Zend_Config $config) { $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();

    if (isset($config->dispatcher) and $config->dispatcher == true){
        $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher();
    }else{
        $dispatcher = null;
    }

    if (isset($config->request) and $config->request == true){
        $request = Zend_Controller_Front::getInstance()->getRequest();
    }else{
        $request = null;
    }

    return new self($defs, $dispatcher, $request);
}

Comments

No comments to display