ECA Form: Broken Ajax rebuilds when Inline Entity Form is involved

Created on 7 July 2025, 5 days ago

Problem/Motivation

When eca_form and inline_entity_form are both installed, there appears a problem when using an "Inline Entity Form - Simple" widget.

Steps to reproduce

  • New Drupal 11.2 installation with standard profile. ECA 2.1.10 and most recent Inline Entity Form module. Install following modules: eca_base, eca_form, eca_content, eca_user, bpmn_io, inline_entity_form
  • Go to "Manage fields" of the "article" content type. There add two file upload fields. Add an entity reference field to node of type "page".
  • Go to "Manage form display" of the "article" content type. There enable "Inline Entity Form - Simple" widget for the entity reference field to the "page" node. Place it underneath the title field, so that the two file upload fields appear below the inline entity form.
  • Now try to create a new "article" node at /node/add/article. Fill in required fields. Skip filling the inline entity form of "page" content, instead try to upload a file at one of the two file upload fields.

You will see that whenever trying to upload a file, the uploaded file does not appear - the widget stays empty after the Ajax refresh.

Proposed resolution

None yet.

Remaining tasks

The problem is being caused by ECA when invoking method Drupal\eca_form\HookHandler::inlineEntityFormAfterBuild. When not invoking this method, the problem does not show up.

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.1

Component

Miscellaneous

Created by

🇩🇪Germany mxh Offenburg

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

Comments & Activities

  • Issue created by @mxh
  • 🇩🇪Germany mxh Offenburg

    Maybe remove the whole implementation of Drupal\eca_form\HookHandler::inlineEntityFormAfterBuild ? Seems it wasn't working well anyways. despite it may be nice to work with the most recent form input on the entity directly, which is way more convenient - it wasn't explicitly requested anytime either.

  • 🇩🇪Germany jurgenhaas Gottmadingen

    I'm open to this approach. This callback has often caused headaches. That said, I'm uncertain about the consequences when removing this. I've never been deep into this and have no idea how much this removal would break out there in the field. @mxh do you have a clue what that would mean?

  • 🇩🇪Germany mxh Offenburg

    It will likely cause breakage of existing processes, and to the worse it will break without error, but logically since the inline entities won't be provided with most recent form input anymore. But since this mechanism is so unreliable, it may be worth getting rid of it.

Production build 0.71.5 2024