Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

Opens referenced entity forms in a Drupal modal dialog instead of embedding them inline. A stable, zero-dependency alternative to Inline Entity Form that avoids nested form state entirely.

Inline Entity Form Dialog provides an entity_reference field widget that lets editors add, edit, and reorder referenced entities without ever nesting one Drupal form inside another.

The problem with Inline Entity Form

Drupal's Form API was not designed for nested forms. IEF embeds a complete entity form — with its own form state, validation pipeline, submit handlers, and AJAX callbacks — inside an outer form being processed by the same pipeline. This causes a well-known class of problems: form state value bleed, cascading AJAX failures when the outer form rebuilds, submit handler ordering conflicts, and repeated breakage on minor core updates (IEF's core file alone exceeds 1,140 lines, most of which are workarounds for these issues).

How this module works

The parent form stores only a JSON array of entity IDs in a hidden input. "Add" and "Edit" buttons open the referenced entity's native form inside a ui-dialog modal — a completely separate page request with its own independent form state. After the dialog saves:

  1. A custom AJAX command (UpdateEntityReferenceCommand) is returned by the server.
  2. The JS handler appends the pre-rendered item row to the widget table and updates the hidden input.
  3. The dialog closes. The parent form is never rebuilt.

On parent form submission, massageFormValues() reads the hidden input and returns the standard ['target_id' => $id] array to Drupal's Field API — exactly as any other entity reference widget does.

Features

  • Add new referenced entities via a dialog (configurable form mode)
  • Edit existing referenced entities via a dialog
  • Remove references (client-side, entity not deleted)
  • Drag-and-drop reorder with Drupal.tableDrag
  • Autocomplete field to reference existing entities
  • Configurable dialog width and form mode per field instance
  • Cardinality enforcement (Add button hidden at limit)
  • Zero contrib dependencies
  • Drupal 11 — uses #[Hook] attribute system throughout

No dependency on Inline Entity Form

This module is a standalone replacement. It does not require, extend, or interact with the inline_entity_form module.

Similar projects

Inline Entity Form:
Drupal's Form API was not designed for nested forms. IEF embeds a complete entity form — with its own form state, validation pipeline, submit handlers, and AJAX callbacks — inside an outer form being processed by the same pipeline. This causes a well-known class of problems: form state value bleed, cascading AJAX failures when the outer form rebuilds, submit handler ordering conflicts, and repeated breakage on minor core updates (IEF's core file alone exceeds 1,140 lines, most of which are workarounds for these issues).

Activity

Total releases
1
First release
Jun 2026
Latest release
21 hours ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Jun 5, 2026