Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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()
Comment | File | Size | Author |
---|
Comments
Comment #1
ral1239 CreditAttribution: ral1239 commentedI 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
Comment #2
MiroslavBanov CreditAttribution: MiroslavBanov commentedOP 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.
Comment #3
esolano CreditAttribution: esolano commentedHi there,
I think 2619550 is a duplicate of this post. In there, you'll find a patch that might solve this issue.
Regards,
Comment #4
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedI 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.
Comment #8
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedSorry, wrong issue. I'll move patch to another place #2619550.
Comment #9
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedComment #10
Matroschker CreditAttribution: Matroschker commentedI 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.
Comment #11
Dave ReidI'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.