Zend Framework

wrong behaviour conected with setElementsBelongTo

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.1
  • Fix Version/s: 1.5.2
  • Component/s: Zend_Form
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

Hi,
I have this piece of code
<?php
set_include_path(get_include_path() . PATH_SEPARATOR .dirname(_FILE_));
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
$view = new Zend_View(array('encoding' => 'UTF-8'));
$form = new Zend_Form();
$element=$form->createElement('text','foo');
$form->addElement($element);
$form->setElementsBelongTo('array');
echo $form->foo->render($view);
echo $form->render($view);
echo $form->foo->render($view);
?>

and the output is something like this

<dt></dt>
<dd>

<input type="text" name="foo" id="foo" value="">

</dd>
<form enctype="application/x-www-form-urlencoded" action="" method="post">
<dl class="zend_form">
<dt></dt>
<dd>

<input type="text" name="array[foo]" id="foo" value=""></dd></dl>

</form>
<dt></dt>
<dd>

<input type="text" name="array[foo]" id="foo" value="">

</dd>

Please notice that the first rendered element isn't in array and after rendering whole form it is.

Issue Links

Activity

Hide
Wil Sinclair added a comment -

Please evaluate and categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and categorize as necessary.
Hide
Matthew Weier O'Phinney added a comment -

Scheduling for next mini release.

Show
Matthew Weier O'Phinney added a comment - Scheduling for next mini release.
Hide
Matthew Weier O'Phinney added a comment -

Fixed in trunk and 1.5 release branch as of r9402.

Show
Matthew Weier O'Phinney added a comment - Fixed in trunk and 1.5 release branch as of r9402.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified