Attaching a field of a node type in another form I have content type 'story' which have an upload field. I have workflow modules installed.

I want the upload field to be presented within the workfloaw form. So within form alter function I did:

field_attach_form('node', $node, $form['append'], $form_state);


then unset all other fields of the story node and appended validation and submit handlers:

$form['#validate'][] = 'node_form_validate';
$form['#submit'][] = 'node_form_submit';


on submission I get this error:

"EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7409 of /var/www/site/includes/common.inc)."

I tried by specifying 'bundle' and 'entity_type':

$form['#bundle'] = 'story';
$form['#entity_type'] = 'node';


and

$form['append']['#bundle'] = 'story';
$form['append']['#entity_type'] = 'node';


but did not help. What can I do?

Thanks.
"EntityMalformedException: Missing bundle property on entity of type node."
means that Drupal does not recognize your entity as a valid one. In the entity info listing, there is a mapping from "bundle" to "type", for nodes.

Either your $node doesn't have a -&gt;type, or Drupal no longer has the type registered. The type could have been removed, either from the UI, or by disabling a feature, and possibly in more interesting ways as well.