Zend Framework

Nesting calls to Zend_View_Helper_Action renders content from inner call twice.

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.3
  • Component/s: Zend_View
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

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:

<div class="sidebar">
<div class="singleContainerMed">
<h3>Question?</h3>
<?php echo $this->action('partner', 'email'); ?>
</div>
</div>

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.

Issue Links

Activity

Hide
Matthew Weier O'Phinney added a comment -

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

Show
Matthew Weier O'Phinney added a comment - Assigning to Ralph and scheduling for next mini release; may be fixed in trunk already.
Hide
Mike Coakley added a comment -

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.

Show
Mike Coakley added a comment - 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.
Hide
alexandru duduta added a comment -

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

Show
alexandru duduta added a comment - 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
Hide
Ralph Schindler added a comment -

Fixed by issue ZF-3456

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

Show
Ralph Schindler added a comment - Fixed by issue ZF-3456 Fixed in trunk at r10438 Fixed in 1.5.3 at r10440 Fixed in 1.6.0 at r10442

People

Vote (1)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: