Delete base field overrides when removing entity fields they override.

Created on 27 March 2019, over 5 years ago
Updated 27 July 2023, about 1 year ago

Problem/Motivation

Base field overrides don't like it very much if you delete the field they override.

When doing a config import of a base field override of a deleted field you get a fatal error:
TypeError: Argument 2 passed to Drupal\Core\Entity\ContentEntityStorageBase::onFieldDefinitionUpdate() must implement interface Drupal\Core\Field\FieldDefinitionInterface, null given

Proposed resolution

A) Base field overrides should probably listen to fields being deleted and delete themself; @Berdir
Or B) They should not affect things if the field they are for not there. For robustnessโ€™s sake; @alexpott
C) Include an update function in core that does this for all entity types. that would only go along with the code that makes them delete themselves if the base field is deleted; @amateescu

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Configurationย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium mpp

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