Community & Support

drupal_render gives php warnings if applied on select type

I am getting an implode error on line 622 in form.inc
Can anybody help?

I am rendering a form element of type select, using drupal_render.

The warning looks like this:
"warning: implode() [function.implode]: Bad arguments. in /includes/form.inc on line 622."

thanks

Comments

Running Drupal 5.7

Running Drupal 5.7

Hey I have the same error and I think is something the form does not like, the error only happens when I inject the checkbox but if the fieldset is empty is ok.
Any help welcome!

<?php

Array (
    [
preview] => Array
        (
            [
0] => Array
                (
                    [
#type] => fieldset
                   
[#title] => Message sent to: myuser [midday (all in one mail)]
                   
[#description] => <HTML TAGS><INSIDE>my content</HTML TAGS>
                   
[tmcheck_32] => Array
                        (
                            [
#type] => checkbox
                           
[#title] => <a href="/user/32">myuser</a> (1Jan70)
                           
[#return_value] => 32
                           
[#default_value] => 1
                       
)

                )
        )

)
?>

...

I am rendering a form element of type select [...]
getting an implode error

The 'select' rendering function, as almost any other element redering function, expects a dozen properties to exist in your element array. These properties are usually inizialized by the Form API. Since you're fiddling with 'select's independently of Form API, these properties aren't set. Add a $element += _element_info('select'); to add some necessary properties (in your specific case it's the '#parents' that's missing).

Thanks, you're right. I

Thanks, you're right. I solve same problem in that case.

nobody click here