EntityFieldManagerInterface::getFieldDefinitions is called with null bundle

Created on 1 February 2023, over 1 year ago

Problem/Motivation

In EntityExistsValidator, EntityFieldManagerInterface::getFieldDefinitions is called with null bundle when validating a bundle-less entity type like user:

/**
 * @EntityExists(
 *     entityTypeId = "user",
 * )
 */
public string $user;

Since argument & return types aren't widely used in core & contrib this is not (yet) a big problem, except when using the Hook Event Dispatcher module.

Proposed resolution

Pass the entity type twice if the bundle is left empty.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium DieterHolvoet Brussels

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

Comments & Activities

Production build 0.69.0 2024