Incorrect type hint in meta_entity_entity_bundle_field_info() hook implementation

Created on 13 June 2025, 23 days ago

Problem/Motivation

In meta_entity.module, the hook_entity_bundle_field_info() implementation currently type-hints both parameters as strings:
function meta_entity_entity_bundle_field_info(string $entity_type, string $bundle): array {

This strict type hint violates the Drupal core hook expectations. According to the Drupal 11.x API documentation, $bundle can be NULL when Drupal requests field info for all bundles of a given entity type.
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

Proposed resolution

Update the hook implementation to allow $bundle to be nullable:
function meta_entity_entity_bundle_field_info(string $entity_type, ?string $bundle): array {

🐛 Bug report
Status

Active

Version

1.5

Component

Code

Created by

🇵🇱Poland alorenc Wolsztyn, 🇵🇱

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024