- π©πͺGermany donquixote
I reopen this, because:
- The widget does not clearly communicate that it only supports a single required value.
- The widget is clearly broken for multiple-value fields or optional single-value fields.Other widgets that don't have a "Remove" button rely on an "emptiness" check: If the field value is determined to be empty, the item is dropped on save. E.g. an empty text field.
But how do we determine emptiness for an inline entity?
I don't think it is possible. If the inline entity has any required field, it becomes impossible to submit without filling all the fields.There is an attempt at documentation in the README:
Two widgets are provided:
- "Inline entity form - Single value" - Shows the inline form in a fieldset
on the parent entity form. No additional action buttons are added.
This widget assumes that it is operating on a single-value required reference
field with one selected bundle.- "Inline entity form - Multiple values" - Shows an advanced widget
for inline management of entities.
Has optimal UX when there's only one bundle selected (this is the
"Product types that can be referenced" setting on product reference fields).This would be great, if the widgets were actually named "Single mandatory value" vs "Multiple value" or similar.
But instead they are named "Simple" vs "Complex".So something needs to change.
Btw, the WidgetInterface::isApplicable() would make it possible to prevent the widget from being used on fields it was not made for.
This would be a BC break, kind of, but on the other hand, this never really worked. Agree that the simple form is nearly unusable without it. Deleting referenced entities should be at least an option.
- πΊπΈUnited States dcam
The Simple widget inherits more of its functionality from the field WidgetBase class. In Drupal 10.2 that class was improved to include the long-standing feature request of a Remove button. See π Allow for deletion of a single value of a multiple value field Fixed .
I have verified that Core's multiple-valued field Remove button works with the IEF Simple widget. Therefore, I'm closing this issue as being outdated.
- Status changed to Closed: outdated
11 months ago 4:39pm 12 January 2024