ECA Form: inline entity form not recognized in specific context
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3452494. --> Reported by: [jurgenhaas](https://www.drupal.org/user/168924) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>We do have an IEF configured to show the complex form, but only if the referenced entity does not yet exist. Otherwise, it displays the reference as a table.</p> <p>In that context, the <code>\Drupal\eca_form\HookHandler::fieldWidgetSingleElementInlineEntityFormComplexFormAlter</code> recognizes the form when the field is populated with an existing referenced entity. But if the entity reference field is empty, there is no form yet, that could be used by the 2 implemented cases, that look for either <code>$element['inline_entity_form']</code> or <code>$element['entities'][$context['delta']]['form']['inline_entity_form']</code>.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>We need a third case which looks for <code>$element['form']['inline_entity_form']</code>.</p>
issue