Add an (optional) "Remove all" button to the complex IEF widget

Created on 20 April 2018, over 6 years ago
Updated 17 February 2023, over 1 year ago

Problem/Motivation

If you use the IEF complex widget for an entity reference and have a lot of entities referenced, it can be a slow process to clear all the references and start clean. This problem is compounded by ✨ Remove without confirmation Closed: outdated and the fact that every time you click "Remove" for a row in your field, you have to confirm the removal. If you have 10 entities referenced, it takes 20 clicks to get back to a clean slate.

Entityqueue gives you a "Clear" button if you need to empty a queue and start fresh. I'm proposing something similar for entity reference fields using IEF.

Proposed resolution

Add a widget setting that enables a 'Remove all' button in the IEF complex widget.

If clicked, it's a single operation to remove all references (but none of the underlying entities) from your field.

Remaining tasks

  1. Decide if this is viable
  2. Write the patch
  3. Get reviews/feedback
  4. Commit
  5. Rejoice

User interface changes

  1. Add a new checkbox to the IEF complex widget's configuration form that controls the presence of the 'Remove all' button. Defaults to FALSE.
  2. If selected, would add such a button to the editor-facing IEF complex widget.
  3. If 'Remove all' is pressed, show an in-place confirmation step.

API changes

Probably none, other than changes to the IEF widget form (and widget settings/config form). Not sure if that counts as an API change.

Data model changes

Change to the config schema to support a new setting in the field widget to enable/disable this functionality.

✨ Feature request
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

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.

Production build 0.71.5 2024