ZF-3160: Nesting calls to Zend_View_Helper_Action renders content from inner call twice.


Nesting a call to Zend_View_Helper_Action in a call to Zend_View_Helper_Action will render the inner call twice, once before the outer call and once within it (as it should be).

In layout:

<?php echo $this->action('get', 'sidebar'); ?>

That renders a view script with the following code:

The viewscript returned in <?php echo $this->action('partner', 'email'); ?> is displayed both above


div class="sidebar"> and within it.

If the viewscript contains the same thing, but does not echo the partner/email action (<?php $this->action('partner', 'email'); ?>), it still is rendered above


div class="sidebar">, but no longer inside it.

The latter scenario should not render it at all.


Assigning to Ralph and scheduling for next mini release; may be fixed in trunk already.

Adam - you have the same issue I reported in the linked bug report (2808). I've offered a fix but there are other issues to consider as well. but to fix your problem quickly see my comments.

adding $this->resetObjects();

in the
class Zend_View_Helper_Action public function action($action, $controller, $module = null, array $params = array()) class Zend_View_Helper_Action

just before return seems to solve this issue

Fixed by issue ZF-3456

Fixed in trunk at r10438 Fixed in 1.5.3 at r10440 Fixed in 1.6.0 at r10442