ZF-11413: Zend_Navigation_Page_Mvc isActive doesn't check for route default params (module, controller, action) but rather to default params for the application

Issue Type: Bug Created: 2011-05-26T13:38:14.000+0000 Last Updated: 2011-06-06T09:21:03.000+0000 Status: Closed Fix version(s): - 1.11.8 (07/Jul/11)

Reporter: Cristian Bichis (avantis) Assignee: Kai Uwe (kaiuwe) Tags: - Zend_Navigation

Related issues: - ZF-11359




Zend_Navigation_Page_Mvc is not looking for page route default params but rather for the default application module/controller/action.

The isActive function is checking at application level, and not at the page route level for the default params...

The sequence is from Zend_Navigation_Page_Mvc class, starting with line 141:

<pre class="highlight">
            if (null !== $this->_module) {
                $myParams['module'] = $this->_module;
            } else {
                $myParams['module'] = $front->getDefaultModule();

            if (null !== $this->_controller) {
                $myParams['controller'] = $this->_controller;
            } else {
                $myParams['controller'] = $front->getDefaultControllerName();

            if (null !== $this->_action) {
                $myParams['action'] = $this->_action;
            } else {
                $myParams['action'] = $front->getDefaultAction();

Sample case below.


<pre class="highlight">
        $type = new Application_Controller_Router_Route_Type(
            array('module'=>'resources', 'controller'=>'types', 'page'=>1),
            array('action' => 'news|reports|articles', 'page'=>'\d+')

For the mvc page defined as :

<pre class="highlight">
                'label' => 'My News',
                'action' => 'news',
                'title' => 'My News'

The isActive resolves the page to params: default/index/news !!! instead of resources/types/news, as should be based on the route default params...


Posted by Cristian Bichis (avantis) on 2011-05-26T13:52:19.000+0000

Some more comments: 1. A test url would be: /news 2. The type route is added after the default route

Posted by Kim Blomqvist (kblomqvist) on 2011-05-26T14:18:39.000+0000

Is this related to ZF-11359?

Posted by Cristian Bichis (avantis) on 2011-05-26T14:21:35.000+0000

Hi Kim,

It seems to be related.

Seems a solution already exists, is just waiting for someone to commit...

Posted by Kai Uwe (kaiuwe) on 2011-05-26T14:44:15.000+0000

@Cristian You are right.

Have you found an issue?

See the Overview section for more details.


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

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