Listing for fields fails with error for BaseField

Created on 21 November 2023, about 1 year ago

Problem/Motivation

When generating a list of fields for an entity that uses a BaseFieldDefinition an error prevents display of the CM document because ->label() does not exist for BaseFieldDefinitions, but does exist for field overrides.

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\Core\Field\BaseFieldDefinition::label() in Drupal\content_model_documentation\CmDocumentViewBuilder->buildFieldRows() (line 280 of modules/contrib/content_model_documentation/src/CmDocumentViewBuilder.php).

This is caused by ->Label() existing for overridden fields but not on basefields (like those from autoentity labels). ->getLabel() is available in both.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States swirt Florida

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

Comments & Activities

Production build 0.71.5 2024