With using inline entity form when creating a second entity on the initial add page, an infinite/circular child reference is created - referencing the parent type's handler.

I've using ief 7.1.x dev, with patch from Add Entity Translation integration applied.

Everything works fine if you just add one entity when creating the parent entity. If you want to add another, or edit the first child entity, the new handler for the new entity gets the same id as the parent, and then the infinite/circular child to self reference is created. I'm guessing this is because the parent is cached so $newId is starting back at 1, instead of being properly incremented.

As a workaround, I added the entity bundle to the generation of $entity_translation_handler_id.

I'm sure there would be a better, more complete fix, but this at least allows it to work and not have notifyChildren() functions run forever in an infinite loop.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Patch to change how entity_translation_handler_id is generated.

plach’s picture

Status: Active » Needs review
+++ b/includes/translation.handler_factory.inc
@@ -114,7 +114,8 @@ class EntityTranslationHandlerFactory {
+      list(, , $bundle) = entity_extract_ids($entity_type, $entity);

Looks good, but can we call entity_extract_ids() just once, please? :)

SocialNicheGuru’s picture

is this still an issue with the new dev release?

ciss’s picture

Status: Needs review » Needs work
ciss’s picture

Status: Needs work » Needs review
FileSize
1.03 KB

I've updated the patch according to #2 and added a fallback to entity_type if bundle is null.

plach’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks.

  • ciss authored a9bc984 on 7.x-1.x
    Issue #2166157 by rsmylski, ciss: entity translation handler id for new...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.