Error: Call to undefined method BaseFieldDefinition::label()

Created on 25 October 2023, 8 months ago
Updated 26 October 2023, 8 months ago

Problem/Motivation

Trying to add the commerce webform order in a site having a commerce order item type with bundle fields, it appears this error: "Error: Call to undefined method Drupal\commerce_donation_suite\Entity\BaseFieldDefinition::label()"

Steps to reproduce

1. Have a site with an order item type with bundle fields . It can happen also if it has just extra base fields.
2. Add commerce order Webform handler.

Proposed resolution

Reading the code, there is a list of base fields being obtained by the method getBaseFieldDefinitions here, and calling method label here. Method label is not available in a base field definition, or any class extending FieldDefinitionInterface, which is what method getBaseFieldDefinitions returns, but it is possible to use getLabel method.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain omarlopesino

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

Comments & Activities

Production build 0.69.0 2024