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

Comments

swirt created an issue. See original summary.

  • swirt committed ce0b34ca on 1.0.x
    Issue #3402994: Listing for fields fails with error for BaseField
    
swirt’s picture

Status: Active » Fixed

This has been fixed and will go out with 1.0.23

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.