0

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.

1
  • From the D 7.22 changelog released today, this is linked there: drupal.org/node/1825844 ... it just smells that this might be relevant to you. I'm not certain you can have an "upload" Field from the FieldAPI be used seperate from its Entity without editing an existing entity (see linked page). You could always use FAPI file_managed element -- which probably defeats you workflow stuff :P – tenken Apr 4 '13 at 20:24
1

"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 ->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.

2
  • No, it is. I loaded it manually using node_load() – Junaid May 28 '12 at 3:03
  • I've rewritten the answer, hopefully a more detailed answer is more helpful. – Letharion May 28 '12 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.