I am wondering if I could get some guidance...I am working with the module http://drupal.org/project/webform_autocomplete. I am having a problem whereby this component can be configured using form_builder and works just fine. However, when you edit the form the options that you have selected do not show selected, even though in the node->webform structure they are set properly. If you save the form again without noticing they are unchecked you lose your configurations. This is the issue raised against webform_autocomplete: #1859704: Options disappear from field in components, but not from the form frontend.

I have tracked down the issue is triggered (not caused) here in form_builder_webform.component.inc:

  // The most up-to-date configuration data stored by Form Builder for the
  // part of the component we are editing is also stored in the passed-in
  // element, and should always take precedence.
  if (array_key_exists("#$property", $element)) {
    drupal_array_set_nested_value($component, $component_nested_keys, $element["#$property"]);
  }

It seems that the #$property is in the element array but is NULL. Is there a _load_alter function that is supposed to be used to ensure the $element['#property'] has been updated?

Also, as an FYI I have put in a workaround which is to change the above code to:

  if (array_key_exists("#$property", $element) && !empty($element["$property"])) {
    drupal_array_set_nested_value($component, $component_nested_keys, $element["#$property"]);
  }

I am sure this is unnecessary if I was properly populating $element.

Thank-you!