At first I thought this was an ubercart issue, but I've tested it on my site for standard CCK image and file nodes and I get the same error. This seems like such a simple error and other people don't seem to be having it, so I'm uncertain what's going on here.

If I attempt to hide a file upload field by clicking "Hide upload", when I go to preview the form the upload is not hidden and I get the following error:

warning: implode() [function.implode]: Invalid arguments passed in (my site directory)/drupal/includes/form.inc on line 837.

form.inc line 837 is the implode line of:

/**
 * Return the error message filed against the form with the specified name.
 */
function form_get_error($element) {
  $form = form_set_error();
  $key = $element['#parents'][0];
  if (isset($form[$key])) {
    return $form[$key];
  }
  $key = implode('][', $element['#parents']);
  if (isset($form[$key])) {
    return $form[$key];
  }
}

I tried throwing some drupal devel dpm in there to investigate the $element map, and $element['parents'] appears to contain three elements: field_my_file (the field name), 0, upload

My experience tells me this is something I've messed up (the server is heavily loaded with modules, perhaps there's a conflict?), but I thought I'd check here to see if anyone had any ideas.

Thanks in advance!
Trevor Bradley

Comments

trevorbradley’s picture

I've tried upgrading to 6.x-1.x, and there's unfortunately no change in the error, or in the visibility of the upload. It's still there even if filtered.

I'm stumped as to what I'm doing differently from everyone else...

rockaholiciam’s picture

Not sure if it helps but I was getting the same error when using the drupal method theme_textfield...adding the #parent attribute fixed it.