Re: QuickForm php warning using DB_DataObject_FormBuilder
| From: | Justin Patrin | Date: | Mon, 27 Jun 2005 18:19:17 +0000 |
| Subject: | Re: QuickForm php warning using DB_DataObject_FormBuilder | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19781@lists.php.net to get a copy of this message | ||
On 6/27/05, Dan C <dankind@gmail.com> wrote:
> Hi All,
>
> I'm getting this error when using the $form->toHtml method of quickForm:
>
> Warning: htmlspecialchars() expects parameter 1 to be string, array
> given in /usr/local/lib/php/HTML/Common.php on line 140
>
> The form was created using DB_DataObject_Formbuilder, and this is only
> happening in one specific instance, otherwise FormBuilder works great.
>
> Now... I'm not sure how to backstep and find out exactly which method
> is calling that. Line 140 is inside the _getAttrString() method, which
> seems to only be called by the getAttributes() method in Common.php.
>
> Running:
> /usr/local/lib/php/HTML/QuickForm$ grep getAttr *
>
> I get 34 results in different files... can anyone recommend a better
> way to debug this so I can find out what's causing this error?
>
Well you can always output the fill attr string in that function. Add
an if(!is_string()) around your echo and see what the other attributes
are. Are you perhaps replacing a date element with a text element?
This could easily happen because of that as the defaults FormBuilder
sets are for the date element.
--
Justin Patrin