Re: QuickForm 3 upgrade and select setDefaults.
| From: | Alexey Borzov | Date: | Thu, 17 Apr 2003 10:42:06 +0000 |
| Subject: | Re: QuickForm 3 upgrade and select setDefaults. | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4905@lists.php.net to get a copy of this message | ||
17 Апрель 2003 14:34, xavier написал:
> i've just upgraded from QuickForm 2.10 to 3.0.1 and have a little
> problem with it ;)
>
> i got a standard QuickForm where i set defaults for elements , since
> upgrade there is a strange behaviour in select defaults.
> Default values are well passed, but are not shown properly in HTML, here
> is the html code i got back:
>
> <option value="13">13</option>
> <option value="14" 0="selected">14</option>
> ^^^^^^^^
> <option value="15">15</option>
>
> And same behaviour for each select default value...
>
> I had a look to source, but was unable to find where is the problem...
> I've checked dependencies and upgraded all HTML_ components.
>
> If anybody have an idea ?
Oops. :]
The problem is in HTML_QuickForm_select::toHtml() method, replace
$this->_updateAttrArray($option['attr'], array('selected'));
by
$this->_updateAttrArray($option['attr'], array('selected' =>
'selected'));
Thanks for the bug report, I'll fix this soon.