Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.3.2

Bug #19802 Repeat: content of repeated static elements is cleared
Submitted: 2013-01-29 01:30 UTC
From: avb Assigned: avb
Status: Closed Package: HTML_QuickForm2 (version 2.0.0)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: 2.0.1    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 45 - 6 = ?

 
 [2013-01-29 01:30 UTC] avb (Alexey Borzov)
Description: ------------ If a static element is added to repeat, its content is effectively removed when a backupChildAttributes() / restoreChildAttributes() cycle is performed, as is done in getChildValues(), validate() and render(). getValue() for statics always returns null while setValue() is equivalent to setContent(). Test script: --------------- $fieldset = new HTML_QuickForm2_Container_Fieldset(); $repeat = new HTML_QuickForm2_Container_Repeat( null, null, array('prototype' => $fieldset) ); $static = $fieldset->addStatic() ->setContent('Content of static element') ->setTagName('p'); // force changing of attributes, getValue() or validate() will also work here $arrayOne = $repeat->render(HTML_QuickForm2_Renderer::factory('array'))->toArray(); $arrayTwo = $repeat->render(HTML_QuickForm2_Renderer::factory('array'))->toArray(); foreach ($arrayOne['elements'] as $fsArray) { echo $fsArray['elements'][0]['html'] . "\n"; } foreach ($arrayTwo['elements'] as $fsArray) { echo $fsArray['elements'][0]['html'] . "\n"; } Expected result: ---------------- <p id="qfauto-2_:idx:">Content of static element</p> <p id="qfauto-2_:idx:">Content of static element</p> Actual result: -------------- <p id="qfauto-2_:idx:">Content of static element</p> <p id="qfauto-2_:idx:"></p>

Comments

 [2014-06-19 01:24 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
Fixed in Git https://github.com/pear/HTML_QuickForm2/commit/e17eecae5ba1182e90c738f608091f60ee9b5683