When using Field collections and Workbench moderation, and when editing a draft of a published content, and creating another draft, I get the error:
Notice: Undefined index: entity keys in entity_extract_ids

Related:
#2458891: Host entity should be updated for revision changes
#2313387: Notice: Undefined index: entity keys in entity_extract_ids()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ral1239’s picture

I get this error too.

Here are some of the cases I've tested to reproduce this error:

Case 1:
1. Save as published
2. Save as draft
3. Save as published
CAUSES ERROR

Case 2:
1. Save as published
2. Save as draft
3. Save as draft
CAUSES ERROR

Case 3:
1. Save as draft
2. Save as publish
NO ERROR

Case 4:
1. Save as draft
2. Save publish
3. Save publish
NO ERROR

Case 5:
1. Save as published
2. Save as draft
NO ERROR

So it seems like whenever a published version of a node is saved and then a draft is created; the next version will show the error regardless if its published or draft.

published -> draft -> draft/published = error

MiroslavBanov’s picture

OP here. For me, the cause was a custom module that was programmatically saving Field Collections and doing that wrong. Hint: the best place for such information is the simpletest implementation of the module.

esolano’s picture

Hi there,

I think 2619550 is a duplicate of this post. In there, you'll find a patch that might solve this issue.

Regards,

eugene.ilyin’s picture

I had the same problem.

I propose this solution for this problem.
Description is in the comments in the patch, but don't hesitate ask more if need.

Status: Needs review » Needs work

eugene.ilyin’s picture

Sorry, wrong issue. I'll move patch to another place #2619550.

eugene.ilyin’s picture

Matroschker’s picture

I have the same error in my system drupal 7.43, workbench moderation 7.x-1.4.

This (https://www.drupal.org/node/2619550) could not be a solution for the error, because I don't have module field_collection.

Dave Reid’s picture

Status: Needs work » Closed (duplicate)

I'm going to mark this as a duplicate of #2619550: Notice: Undefined index: entity keys in entity_extract_ids(). It's either the Field Collection bug, or some other custom code.