How to remove item with Simple widget?

Created on 27 June 2018, about 6 years ago
Updated 12 January 2024, 6 months ago

I have no "remove" button for items when i use "simple" ief widget. So, i can remove items only with "Complex" widget?

πŸ’¬ Support request
Status

Closed: outdated

Component

User interface

Created by

πŸ‡ΊπŸ‡¦Ukraine cosolom

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺ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 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dcam
Production build 0.69.0 2024