Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.10.5, 1.10.8
-
Fix Version/s: None
-
Component/s: Zend_Controller
-
Labels:None
Description
We've got a module named "manager". It works with /manager URI. However, when someone opens /Manager, we get:
ErrorException with message "Undefined index: Manager" in /Users/ikr/Sites/ch.xyz.local/library/Zend/Controller/Dispatcher/Standard.php on line 384 #0 /Users/ikr/Sites/ch.xyz.local/library/Zend/Controller/Dispatcher/Standard.php(384): __lambda_func(8, 'Undefined index...', '/Users/ikr/Site...', 384, Array) #1 /Users/ikr/Sites/ch.xyz.local/library/Zend/Controller/Dispatcher/Standard.php(204): Zend_Controller_Dispatcher_Standard->getControllerClass(Object(Zend_Controller_Request_Http)) #2 /Users/ikr/Sites/ch.xyz.local/library/Zend/Controller/Dispatcher/Standard.php(244): Zend_Controller_Dispatcher_Standard->isDispatchable(Object(Zend_Controller_Request_Http)) #3 /Users/ikr/Sites/ch.xyz.local/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /Users/ikr/Sites/ch.xyz.local/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() #5 /Users/ikr/Sites/ch.xyz.local/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #6 /Users/ikr/Sites/ch.xyz.local/public/index.php(18): Zend_Application->run() #7 {main}
I guess, the ZF site has the same problem. Try http://framework.zend.com/mAnual/en/ instead of http://framework.zend.com/manual/en/
I'd expect either a 404 instead, or a dispatch to the correct module, ignoring the case in its name.
The issue is still present.
I am new to ZF, so I'm not sure about case rules... For myself, I fixed it by
modifying Zend_Controller_Request_Abstract->getModuleName() and ->setModuleName() to:
/**
*
*/
public function getModuleName()
{
if (null === $this->_module) { $this->_module = strtolower($this->getParam($this->getModuleKey())); }
return $this->_module;
}
/**
*
*/
public function setModuleName($value) { $this->_module = strtolower($value); return $this; }
- Retrieve the module name
*
- @return string
*/
public function getModuleName()
{
if (null === $this->_module) {
$this->_module = strtolower($this->getParam($this->getModuleKey()));
}
return $this->_module; } /**