Details
Description
There seem to be a bug on SPL level: ArrayObject does not report as Iterator with PHP 5.2.4. It implements ArrayAccess, which indirectly implements Iterator via ArrayIteartor.
This causes a bug when providing an empty ArrayObject to the partialLoop view helper.
Fails:
<?php echo $this->partialLoop('catalog/products.phtml', new ArrayObject()) ?>
Works:
<?php $object = new ArrayObject() ?> <?php echo $this->partialLoop('catalog/products.phtml', $object->getIterator()) ?>
To fix this in ZF, we need to add an extra check in the partialLoop helper that checks for ArrayObject:
if (!is_array($model) && (!$model instanceof Iterator or !$model instanceof ArrayObject)) { }
Reported by Matthew:
http://bugs.php.net/bug.php?id=44793