Provide help text on Entity Reference widgets if there's no referenceable entity

Created on 7 March 2019, over 5 years ago
Updated 25 August 2023, about 1 year ago

Problem/Motivation

If no eligible referenceable entity exists, the user won't have anything to choose from, nor may they create an entity, nor may they do anything about it. It's just clutter and a distraction, in some cases amounting to a WTF, particularly if the field is marked required, so the form can't be submitted at all.

Steps to reproduce

This scenario can be reproduced in two ways:

  1. When the target bundle that the entity reference field is referring to has no entities.
  2. When the target bundle that the entity reference field is referring to does not exist.

While the first situation sounds a bit irrational (yet likely to occur), the second situation is a possible edge case. In both the scenarios the user is left with no referenceable entities.

Proposed resolution

Providing a message that describes the problem to the user would help but there is a broader issue that needs discussion for a more complete solution.

Remaining tasks


Come up with a complete solution.
Tests

User interface changes

Added descriptive text to ER widgets when no referencable entities are available.

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Entity referenceย  โ†’

Last updated 15 days ago

No maintainer
Created by

Pancho UTC+2 ๐Ÿ‡ช๐Ÿ‡บ EU

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.

  • Field UX

    Usability improvements related to the Field UI

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