Inline Entity Form affects parent entity fields in edit mode

Created on 9 January 2024, over 1 year ago

Problem/Motivation

When we add a content type as an entity reference on another content type and enable Inline Entity Form on the referenced entity, it doesn't pass some of the parent entity fields in the hook_entity_update . It only occurs when we edit the entity which was previously added as reference.

Steps to reproduce

  1. Create a content type, with one or more simple fields.
  2. Add another content type with atleast one or more basic fields and one entity reference field which references the first content type created
  3. Go to the Manage form display of the 2nd content type and enable Inline entity form - Complex as the widget for the entity reference field.
  4. Create a content for content type 2 with basic data and also add the content type one using the Inline entity form.
  5. Implement hook_entity_update in your custom module with code trying to access the basic fields of content type 2
  6. Edit the content which was created, In the entity reference part, click on edit and then click on Update
  7. Click on Save in the parent form. Observe the data passed in the hook_entity_update.
  8. You can see that the parent form values are not passed to the hook properly

Proposed resolution

Remaining tasks

  1. Investigate and create a patch
  2. Review the patch
  3. Commit to the branch

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇮🇳India arisen Goa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024