Doesn't support computed fields

Created on 3 May 2021, over 3 years ago
Updated 1 February 2023, almost 2 years ago

Problem/Motivation

Call to undefined method Drupal\Core\Field\BaseFieldDefinition::getThirdPartySetting() in /app/web/modules/contrib/link_allowed_hosts/link_allowed_hosts.module:81

Steps to reproduce

In a custom module add this computed field definition.

/**
 * Implements hook_entity_bundle_field_info_alter().
 */
function mycustom_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {
  if ($entity_type->id() == 'node') {
      $fields['magic_button'] = BaseFieldDefinition::create('link')
        ->setLabel(t('View Button'))
        ->setName('view_button')
        ->setDescription(t('Custom Magic Button.'))
        ->setComputed(TRUE)
        ->setClass(MyCustomMagicButton::class)
        ->setDisplayConfigurable('view', TRUE)
        ->setDisplayConfigurable('form', FALSE);
    }
  }
}

Proposed resolution

@see patch

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024