ZF-2887: Zend_Controller triggers Notice:

Issue Type: Bug Created: 2008-03-15T14:29:27.000+0000 Last Updated: 2008-03-21T17:34:14.000+0000 Status: Resolved Fix version(s): - 1.5.1 (25/Mar/08)

Reporter: Martin Hujer (mhujer) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

Related issues: - ZF-2609



Index: I:/xampp/php/PEAR/Zend15/library/Zend/Controller/Dispatcher/Standard.php

When there is not default module directory, it triggers a Notice:

<pre class="highlight">
Notice: Undefined index: default in I:\xampp\php\PEAR\Zend15\library\Zend\Controller\Dispatcher\Standard.php on line 383

It should raise an exception:

<pre class="highlight">
Index: I:/xampp/php/PEAR/Zend15/library/Zend/Controller/Dispatcher/Standard.php
--- I:/xampp/php/PEAR/Zend15/library/Zend/Controller/Dispatcher/Standard.php    (revision 8831)
+++ I:/xampp/php/PEAR/Zend15/library/Zend/Controller/Dispatcher/Standard.php    (working copy)
@@ -380,6 +380,10 @@
         $controllerDirs      = $this->getControllerDirectory();
         $this->_curModule    = $this->_defaultModule;
+        if (!in_array($this->_defaultModule, $controllerDirs)) {
+            throw new Zend_Controller_Exception('Default module \'' . $this->_defaultModule . '\' was not found in controller directory.');
+        }
         $this->_curDirectory = $controllerDirs[$this->_defaultModule];
         $module = $request->getModuleName();
         if ($this->isValidModule($module)) {

EDIT: no, this solution is wrong, but it should be handled somehow.


Posted by julien PAULI (doctorrock83) on 2008-03-16T08:01:08.000+0000

Please, see

Posted by Matthew Weier O'Phinney (matthew) on 2008-03-16T08:19:28.000+0000

Scheduling for 1.5.1. This issue will only affect a small number of users, and the obvious solution until a "fix" is provided is to define a 'default' module, or to tell the dispatcher which module should be considered the default.

Posted by Matthew Weier O'Phinney (matthew) on 2008-03-21T15:49:51.000+0000

Fixed in trunk and 1.5 release branch

Posted by Wil Sinclair (wil) on 2008-03-21T17:34:14.000+0000

I'm assuming this fix is merged to the 1.5 release branch for release with 1.5.1. Please update JIRA if this is not the case.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.