eca_form: Impossible or hard to identify an inline entity form

Created on 16 March 2023, over 1 year ago
Updated 22 March 2023, over 1 year ago

Problem/Motivation

The Inline Entity Form module enables to embed entity forms into entity forms. ECA Form events can currently also be applied to such inline entity forms.

However, it's currently hard (or even impossible?) to distinguish within an ECA process, whether the form is an inline entity form. That may lead to the situation, that a user may want to display a form element in the "main" form, but not in the inline entity form - but since it cannot distinguished, the form element will also be displayed in the inline entity form.

It's hard to identify an inline entity form, because it neither provides its own form ID nor does it provide its own form operation.

We need a concept for an easy distinguish between "main" entity forms and inline entity forms.

Steps to reproduce

Proposed resolution

I'm not sure yet. We could add an option to any form event, that allows to enable the event for inline entity forms. Not sure though whether that's the right approach. Suggestions welcome.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.2

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
  • 🇩🇪Germany mxh Offenburg

    In the issue fork I've added a new condition that enables to check whether the current form is an inline entity form. This may be an approach. If so, this needs test coverage.

  • @mxh opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany mxh Offenburg

    It looks like inline entity forms currently only work when reacting upon "Build form" events. But this may be a topic of another issue. I've added a test with a sample model that distinguishes on an inline entity form using the condition.

    "Waiting for branch to pass" is currently showing because tests are currently failing because of a recent commit in 1.2.x.

  • 🇩🇪Germany jurgenhaas Gottmadingen

    We have implemented the hook eca_form_inline_entity_form_entity_form_alter, shouldn't that automatically identify inline entity forms and set a flag that helps to identify inline entify forms?

  • 🇩🇪Germany mxh Offenburg

    The way Inline Entity Form renders the form of an entity inside another form is different how Entity API renders entity forms.

  • Status changed to RTBC over 1 year ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Looking good, only removed some left-overs from the info file of the test module.

  • Status changed to Fixed over 1 year ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024