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';
$form['append']['#bundle'] = 'story'; $form['append']['#entity_type'] = 'node';
but did not help. What can I do?