By dparrott on
I'm trying to show the taxonomy select in a module I am slowly building. the select shows up fine, but I get this warning:
warning: implode() [function.implode]: Invalid arguments passed in /Library/WebServer/Documents/rebuild/includes/form.inc on line 823.
I take a look at the array passed to theme_taxonomy_term_select and the array I am passing to it, and they look exactly alike. Why does this warning show up for me, but not for the taxonomy module when the code and data structure are alike? And, how can i make this warning go away?
Any help would be appreciated,
dave
/**
* Implementation of hook_block()
*/
function mymodule_block($op='list', $delta=0, $edit=array()) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t('My Module');
return $blocks;
case 'view':
//to do: strip out unneeded arguments from taxonomy_content to try to make the warning go away
$taxonomy_content = taxonomy_form(1);
$tax_content = array();
$tax_content['#title'] = $taxonomy_content['#title'];
$tax_content['#value'] = $taxonomy_content['#value'];
$tax_content['#options'] = $taxonomy_content['#options'];
$tax_content['#description'] = $taxonomy_content['#description'];
$tax_content['#extra'] = $taxonomy_content['#extra'];
$tax_content['#multiple'] = $taxonomy_content['#multiple'];
$tax_content['#required'] = $taxonomy_content['#required'];
//print_r($tax_content);
//print_r($taxonomy_content);
$content = theme('taxonomy_term_select', $tax_content);
$blocks['subject'] = t('Your Location');
$blocks['content'] = $content;
return $blocks;
}
}
Comments
Same error
Sorry to post without a solution. I just wanted to say I am mysteriously getting this warning as well. It seems pretty random through most parts of the site, and I am not using taxonomy at all. It also doesn't seem to affect anything that I've noticed.
Form.inc line 823 - what do you want??
yeah
it doesn't seem to hurt anything at all. just weird that it comes up for my call to the same function that taxonomy calls in its core with the same exact data. i get errors/warnings - it doesn't.
calling it wrong
i figured out how to show a taxonomy select in a form
it must need to be in the form api to work properly. and, you have to call their higher level function.