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


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:

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().


Patch and unit test added.

Fixed in r24458