Hide the "Add existing [label]" button if there are none to reference

Created on 7 January 2024, 9 months ago
Updated 8 January 2024, 9 months ago

Problem/Motivation

I'm using IEF with a profile β†’ entity reference field, complex widget. Users have to select from one of their profiles when creating a certain entity. If they have no existing profiles, it's a bit of a UI WTF to offer a "Add existing $label" button to do an AJAX command to reveal a form element that can select nothing.

It'd be great if the widget could figure out if there are *any* reference-able entities, and if there are none, to hide this aspect of the widget entirely.

Steps to reproduce

Proposed resolution

Have the complex widget check for any possible entities the current user can reference, and if there are 0, hide the "Add existing X" button + UI elements.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs work

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024