Fatal error: Declaration of EntityReferenceLayoutItemNormalizer normalize must be compatible with EntityReferenceItemNormalizer normalize in EntityReferenceLayoutItemNormalizer.php on line 34

Created on 24 June 2025, 10 days ago

When ERL is installed on Drupal >= 10.4.x the above error is seen.

The solution is to change:

  public function normalize($field_item, $format = NULL, array $context = []) {

... to:

  public function normalize($field_item, $format = NULL, array $context = []): array|string|int|float|bool|\ArrayObject|NULL {

... in entity_reference_layout/src/Normalizer/EntityReferenceLayoutItemNormalizer.php

Will upload a patch in a second.

A

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom alexharries

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

Comments & Activities

Production build 0.71.5 2024