Exceptions when a custom entity type has no label

Created on 15 May 2025, 2 months ago

Problem/Motivation

This error is triggered when using DraggableListBuilder and entity forms for any custom entity type without a label:

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/docroot/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 431 of core/lib/Drupal/Component/Utility/Html.php).

This is a side effect of https://www.drupal.org/project/drupal/issues/3255637 β†’

Steps to reproduce

Create a custom entity type without a label. Attempt to use DraggableListBuilder or save the entity using an entity form.

Proposed resolution

Consider reverting https://www.drupal.org/project/drupal/issues/3255637 β†’

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡ΊπŸ‡ΈUnited States john.oltman

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

Comments & Activities

Production build 0.71.5 2024