ZF-9815: Zend_Navigation_Container::addPages() should accept a Zend_Navigation_Container

Issue Type: Bug Created: 2010-05-07T16:43:34.000+0000 Last Updated: 2011-09-11T18:34:10.000+0000 Status: Resolved Fix version(s): - 1.11.11 (29/Sep/11)

Reporter: Stewart Lord (stewartlord) Assignee: Frank Brückner (frosch) Tags: - Zend_Navigation

Related issues: Attachments: - Container.php.patch


The addPages() method of Zend_Navigation_Container only takes an array or a Zend_Config instance. It should also accept a Zend_Navigation_Container.

It's a fairly minor fix. Insert the following into the addPages method:

<pre class="highlight">
if ($pages instanceof Zend_Navigation_Container) {
    $pages = iterator_to_array($pages);

The docblocks and exception message will also need updating. Note: this uses iterator_to_array instead of getPages so that the order of pages will be consistent with calling toArray().


Posted by Frank Brückner (frosch) on 2011-09-05T16:47:20.000+0000

Patch and unit test added.

Posted by Pádraic Brady (padraic) on 2011-09-11T18:34:10.000+0000

Fixed in r24458

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.