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

Bug #5213 Where?
Submitted: 2005-08-26 16:43 UTC
From: pear at david dot endeavorcomputing dot com Assigned:
Status: Wont fix Package: HTML_QuickForm
PHP Version: 5.0.4 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-08-26 16:43 UTC] pear at david dot endeavorcomputing dot com
Description: ------------ HTML entities use a OO shortcutting method to push their HTML, which destroys proper recursive rendering. This is very bad when putting HTML elements into group objects. The HTML all appears before the group's template even begins. I saw other bug reports related to the OO shortcircuit, but not this specific problem. Test script: --------------- I traced the problem to this hunk of code in HTML/QuickForm/html.php: function accept(&$renderer) { $renderer->renderHtml($this); } My sort-of fix is this: function accept(&$renderer) { if ($renderer->_inGroup) { $renderer->renderElement($this); } else { $renderer->renderHtml($this); } } Unfortunately, my fix continues to violate OO principles by accessing a private data member (easily fixed with an accessor function) and using the shortcut method for main-form rendering. However, this fix does behave intuitively and should work with any existing code that doesn't actually use the HTML-in-group rendering error. Expected result: ---------------- HTML printing in proper order in a group. Actual result: -------------- HTML elements come first in order, then the rest of the group members follow.

Comments

 [2005-08-30 10:36 UTC] avb
'html' elements are deprecated, no behaviour related to them will ever be fixed. If you need to put some raw html into groups use 'static' elements.
 [2005-08-30 12:18 UTC] pear at david dot endeavorcomputing dot com
In that case, the documentation should make the depreciation more clear. The only thing it says right now is that the HTML element is intended for only the default renderer.
 [2005-08-31 08:10 UTC] avb
Agree here, will update the documentation soon.
 [2005-09-08 18:45 UTC] phppear at boonedocks dot net
Another request to update the documentation. I just wasted an hour discovering this today.
 [2005-09-12 14:33 UTC] avb
Updated the docs... The changes will be online after next doc rebuild.