Home » HTML » HTML_QuickForm » Bug #745
ArraySmarty breaks without Group appendname - here is my fix
Details
| Submitted | 2004-02-12 23:34 UTC |
|---|---|
| From | hlarue at siegewerks dot com |
| Assigned | ths |
| Status | Closed |
| Package | HTML_QuickForm |
| PHP Version | 4.3.3 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-02-12 23:34 UTC] hlarue at siegewerks dot com
Description:
------------
Found that my button groups were killing the rendering process when I chose not to append the groupnames to the elements. ArraySmarty was removing the beginning of the key name, expecting to remove the group name, whether it existed or not...
Here's my temporary fix and my thanks for all of your great work!
Cheers!
Reproduce code:
---------------
// special handling for elements in native groups
if ($this->_currentGroup) {
// skip unnamed group items unless radios: no name -> no static access
// identification: have the same key string as the parent group
if ($this->_currentGroup['keys'] == $sKeys and 'radio' != $ret['type']) {
return false;
}
// reduce string of keys, ** IF NECESSARY **, by remove leading group keys
if (strpos($sKeys, $this->_currentGroup['keys']) !== false) {
$sKeys = substr_replace($sKeys, '', 0, strlen($this->_currentGroup['keys']));
}
}
[2004-02-13 09:18 UTC] ths at php dot net
I removed such check from code because I saw no reason for it.. Can you please send an piece of code, that show these "killing the rendering process"?
If so I will add these additional check:
if (0 === strpos($sKeys, $this->_currentGroup['keys'])) {
$sKeys = substr_replace($sKeys, '', 0, strlen($this->_currentGroup['keys']));
}
Thank you.
[2004-02-14 10:57 UTC] ths at php dot net
This bug has been fixed in CVS.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.
In case this was a pear.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.