ZF-6268: Zend_Controller_Dispatcher_Standard raises notice if modules added via the "addModuleDirectory" method have upper case first letters in their directory names


For example, in the directory that contains my Modules, they're all named with an upper case first letter, let's say its list is: Core Test

If I try to go to mydomain.com/Test, it correctly routes the request to the Test module's Test_IndexController::indexAction() method. If I go to mydomain.com/test (which should be the one that works I think), I get this error:

NOTICE [8] Undefined index: test Notice on line 373 in file /xxx/lib/Zend/Controller/Dispatcher/Standard.php

This is because the addModuleDirectory doesn't lower case the name of the modules when it adds them, but when the Zend_Controller_Dispatcher_Standard checks if the module exists or not, in Zend_Controller_Dispatcher_Standard::isValidModule, it lower cases the module name for the check, but not when it accesses the module array in line 373: $this->_curDirectory = $controllerDirs[$module];

So either the addModuleDirectory method must transform the module names to lower case when it adds them, or the dispatcher must be made case sensitive.


removing full path

Similarly to Carlos description, when the module name in file system is lowercase, and the first character of module name in URL is uppercase, PHP also throws a notice.

Notice: Undefined index: Test in /xxx/Zend/Controller/Dispatcher/Standard.php on line 379

I think, that the Zend_Controller_Dispatcher_Standard::isValidModule method have to test the module name for case sensitivity.

Zend version: $Id: Standard.php 19236 2009-11-25 14:45:08Z bate $

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.