Issues

ZF-11550: Zend_Navigation_Page_Mvc::isActive does not true, when route is active

Description

Pls see below for routes.xml and navigation.xml.

When I go to:

http://www.example.com/en_US/default/index/index/

I would expect:

<?php echo $this->activeNavigation()->get('title'); ?>
<?php echo $this->activeNavigation()->get('label'); ?>

in the View to output:

Home
Home

as it does in ZF 1.11.7 and earlier.

In ZF 1.11.8,

<?php Zend_Debug::dump($this->activeNavigation()); ?>

returns

NULL

and it should return:

object(Zend_Navigation_Page_Mvc)#54 (24) { [...] }

By overwriting the method Zend_Navigation_Page_Mvc::isActive in ZF 1.11.8 with the method Zend_Navigation_Page_Mvc::isActive from ZF 1.11.7 the issue can be resolved.

The issue, it would seem, is caused by the last fix in Zend_Navigation_Page_Mvc::isActive in ZF 1.11.8.

This is a "Blocker", as it break the entire web site.

routes.xml:

<?xml version="1.0" encoding="UTF-8"?>

:locale/:module/:controller/:action/*defaultindexindex.*.*.*.*

navigation.xml:

<?xml version="1.0" encoding="UTF-8"?>

Zend_Navigation_Page_MvcdefaultdefaultindexindexHome
        Home

Comments

The reason this worked in 1.11.7 is because the route was ignored completely, and only the module/controller/action was checked.

However, changing the handling of the null parameter (for the locale in your case) will fix this issue (but I'm not sure if that is the correct thing to do).

Look at this patch on how to do that: http://pastie.org/2203185

I can confirm that in the case that I described, your fix resolves the issue.

Added a test case for the MVC nav page which failed prior to applying the patch, passed following. Merged to master and 1.11 release branch.