Call to undefined method BundleFieldDefinition::id()

Created on 25 March 2024, 3 months ago

Problem/Motivation

We define a field programmatically using "BundleFieldDefinition::create()" in hook_entity_bundle_field_info(). We don't use config. tmgmt_content doesn't like it:

Error: Call to undefined method Drupal\my_module\Field\BundleFieldDefinition::id() in tmgmt_content_form_tmgmt_settings_form_alter() (line 193 of modules/contrib/tmgmt/sources/content/tmgmt_content.module).

Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'tmgmt_settings_form') (Line: 840)
Drupal\Core\Form\FormBuilder->prepareForm('tmgmt_settings_form', Array, Object) (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)

This is similar to this issue: https://www.drupal.org/project/ui_patterns_settings/issues/3248320 β†’

Steps to reproduce

Install commerce and its sub-module commerce_payment. Go to TMGMT settings page. See error.

Proposed resolution

Check if $storage_definition instanceof FieldStorageConfig.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Source: Entity

Created by

πŸ‡ΊπŸ‡ΈUnited States charginghawk

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024