Issues

ZF-10282: no active page children if minDepth > active depth

Issue Type: Bug Created: 2010-08-08T08:31:06.000+0000 Last Updated: 2012-11-20T21:37:29.000+0000 Status: Open Fix version(s): Reporter: Sergio Vaccaro (hujuice) Assignee: None Tags: - Zend_Navigation

Related issues: Attachments:

Description

Consider this code:

<pre class="highlight">$this->navigation()->menu()->setMinDepth($minDepth);
$this->navigation()->menu()->setOnlyActiveBranch(true);
echo $this->navigation()->menu();

and the container shown below for readability.

If $minDepth is 1 the view helper will render: * L'Istituto <--- this is the active page, depth 1 ** Organizzazione ** Attività

If $minDepth is 2 the view helper will render... nothing.

This is quite strange. If "onlyActiveBranch" means "only active branch and children", when $minDepth is 2 I should still see the submenu. If "onlyActiveBranch" means "only active branch and no children", I should see no children even when $minDepth is 1. The first meaning ("only active branch and children") should be valid, in my opinion.

Here is the dump of the container (toArray):

<pre class="highlight">
Array
(
    [0] => Array
        (
            [label] => Pagina iniziale
            [id] => 
            [class] => 
            [title] => 
            [target] => 
            [rel] => Array
                (
                )

            [rev] => Array
                (
                )

            [order] => 
            [resource] => 
            [privilege] => 
            [active] => 
            [visible] => 1
            [type] => Zend_Navigation_Page_Uri
            [pages] => Array
                (
                    [0] => Array
                        (
                            [label] => L'Istituto
                            [id] => 51
                            [class] => 
                            [title] => 
                            [target] => 
                            [rel] => Array
                                (
                                )

                            [rev] => Array
                                (
                                )

                            [order] => 
                            [resource] => 
                            [privilege] => 
                            [active] => 1
                            [visible] => 1
                            [type] => Zend_Navigation_Page_Uri
                            [pages] => Array
                                (
                                    [0] => Array
                                        (
                                            [label] => Organizzazione
                                            [id] => 69
                                            [class] => 
                                            [title] => 
                                            [target] => 
                                            [rel] => Array
                                                (
                                                )

                                            [rev] => Array
                                                (
                                                )

                                            [order] => 
                                            [resource] => 
                                            [privilege] => 
                                            [active] => 
                                            [visible] => 1
                                            [type] => Zend_Navigation_Page_Uri
                                            [pages] => Array
                                                (
                                                )

                                            [uri] => /it/L%27Istituto/Organizzazione
                                        )

                                    [1] => Array
                                        (
                                            [label] => Attività
                                            [id] => 73
                                            [class] => 
                                            [title] => 
                                            [target] => 
                                            [rel] => Array
                                                (
                                                )

                                            [rev] => Array
                                                (
                                                )

                                            [order] => 
                                            [resource] => 
                                            [privilege] => 
                                            [active] => 
                                            [visible] => 1
                                            [type] => Zend_Navigation_Page_Uri
                                            [pages] => Array
                                                (
                                                )

                                            [uri] => /it/L%27Istituto/Attivit%C3%A0
                                        )

                                )

                            [uri] => /it/L%27Istituto
                        )
[...]

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts