When pushing a node from staging to live server via deploy module, I get an error on the live server:
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7634 of /opt/drupal/includes/common.inc).
It looks like this was caused by workbench_moderation_store(), which is triggered by _drupal_shutdown_function() (not sure, if it should be triggered in a deploy context). At line 1572 of workbench_moderation_store(), node_save($live_revision) is called, with the following argument for $live_revision:
Array
(
[status] => 1
[revision] => 0
[workbench_moderation] => Array
(
[updating_live_revision] => 1
)
)
which for sure is no node (though the node has been filled into workbench_node_store) and lacks not only a bundle property.
Comment | File | Size | Author |
---|---|---|---|
#3 | workbench_moderation-entitymalformed-1919706-3.patch | 1.63 KB | jojonaloha |
#2 | workbench_moderation-entitymalformedexception-action-1919706-2.patch | 493 bytes | wbobeirne |
#1 | 1919706-1-no-node.patch | 522 bytes | jneubert |
Comments
Comment #1
jneubert CreditAttribution: jneubert commentedJust a quick workarround
Comment #2
wbobeirne CreditAttribution: wbobeirne commentedThe bigger issue (In my case, which is using Views Bulk Operations set moderation action) is that 'behavior' => array('changes_property') is set in the action info definition. What this does is call an entity_save before the drupal_shutdown_function is run. This is during a state where it thinks it's got $node->workbench_moderation['published'] set, but it's actually been unset. This causes workbench_moderation_node_live_load in workbench_moderation_store to return nothing, because there's no live node to load.
Attached is a patch that removes that behavior from the action.
Comment #3
jojonaloha CreditAttribution: jojonaloha commentedAttached is a patch that takes into account that workbench_moderation_node_live_load() may return nothing if there is no published version. Also, node_load() may actually return FALSE in rare cases. In that case, we shouldn't try to save the node.
I haven't tested the patch in #2, but it may be that the patch in #2 should be applied as well, but this patch should resolve the EntityMalformedException in all cases, not just with VBO.
Comment #4
jamsilver CreditAttribution: jamsilver commentedYep, just bumped into this issue too while Using Deploy & Features to export Entities.
Comment #5
Poindexterous CreditAttribution: Poindexterous commentedI'm having this issue pop up with bulk operations using rules components. As bulk operations "publish" and "unpublish" don't sync up with workbench moderation I tried making some rules components to pub/unpub and sync the workbench moderation state. I'm having an unanticipated problem with publishing from an unpublished workbench state through this method. Not only do I get the entity malformed error, but the node seems to go through two workbench transitions (unpub-state --> pub, then pub-->draft) instead of one (unpub-state -->pub). It seems as though the node is saved twice with the entity malformed error in between them. I'm a bit new to drupal development so I'm still trying to figure out how to solve this. I was also looking at issue #1147646 Hard coded 'Draft' status in .module, since the node is saved as "draft" instead of "published". I'm wondering if it's not just the entity bundle info that's missing when this error occurs, but perhaps the workflow status is null as well, causing workbench to insert the default state.
Comment #6
Poindexterous CreditAttribution: Poindexterous commentedThanks! Patch #3 got rid of my entity malformed error from using bulk operations rules components to change the moderation state. The double-save with the incorrect moderation state is still there, but it's likely a completely different issue.
Comment #9
colanComment #10
colanForgot to set this up for forward porting.
Comment #11
das-peter CreditAttribution: das-peter commentedDoes not apply to the 2.x branch, it uses State Machine / State Flow for those operations.