ZF-2609: ZCDispatcher_Standard shows notices when default module does not exist and/or was not set
Description
Assuming the simple following boostrap :
// ... some easy minimal code here
$frontController = Zend_Controller_Front::getInstance();
$frontController->addControllerDirectory($appDir . '/main/controllers','main');
$frontController->dispatch();
If I would like the 'main' module to be the default one, I should have written $frontController->setDefaultModule('main'); But I don't, I assume dispatcher will find it on its own.
If all right, then Dispatcher will dispatch my 'main' module (namespaced, that's correct as it's not declared as being the default module) but it will show some notices : Notice: Undefined index: default in path/to/Zend/Controller/Dispatcher/Standard.php on line 330
I think that the default module should be always set (id 'default' then the directory must exist or any declared with setDefaultModule()), and Dispatcher should throw an exception if it's not the case.
See the patch attached, that redefines the getActionMethod() for that. it seems to break some tests, maybe that's not a good patch, I'm on it.
Comments
Posted by julien PAULI (doctorrock83) on 2008-02-10T12:38:54.000+0000
This patch looks better
Posted by julien PAULI (doctorrock83) on 2008-02-11T11:57:01.000+0000
Here are the tests for the second patch.
Posted by Matthew Weier O'Phinney (matthew) on 2008-02-20T11:08:02.000+0000
Resolved in trunk. Passing the front controller or dispatcher parameter 'prefixDefaultModule' will ensure the controllers in the default module are namespaced.