.. which leads to a the following error when editing a translation of that node:
EntityMalformedException: Missing bundle property on entity of type field_collection_item. in entity_extract_ids() (line 7389 of /home/diederik/Openbaar/vanilla/includes/common.inc).
After deletion, the collection field of the still existing translations of that node hold a reference to that entity, but the entity has been deleted.
I attached an image of the (selenium) test case I use. The node type in the test is "Translatable with collection" (with translation, require language). The included collection has one textfield: twc-coll-textfield. Modules I enabled for the test are: i18n_node, field_collection.
Comment | File | Size | Author |
---|---|---|---|
#1 | deleting-a-translated-node-with-a-collection-also-deletes-collection-entity-1315432-1.patch | 1.61 KB | zilverdistel |
Selenium test case | 65.76 KB | zilverdistel |
Comments
Comment #1
zilverdistel CreditAttribution: zilverdistel commentedAttached is a patch that solves this by checking if other host entities still use the field-collection entity. If it is still in use, the field collection entity won't be deleted.
Comment #2
Daniel Wentsch CreditAttribution: Daniel Wentsch commentedThanks a lot, patch works perfectly!
Comment #3
zilverdistel CreditAttribution: zilverdistel commentedComment #4
tim.plunkettCan't RTBC your own patch. Let's get another review here.
Also, your patch introduces some trailing whitespace, can you reroll it?
Comment #5
mariancalinro CreditAttribution: mariancalinro commentedHi guys, I have this patch applied on one live website (for about a week and a half), and it's working fine. I did test it on my local environment, the client tested it on the staging environment, so I guess it's RTBC.
Comment #6
tim.plunkettThanks!
I went with key() instead of array_shift(array_keys());
http://drupalcode.org/project/field_collection.git/commit/ff45e3d