entity_usage_validate_entity_update should reference media label, not field that may not exist

Created on 21 April 2023, about 1 year ago

Problem/Motivation

entity_usage_validate_entity_update makes a call to $media->get('field_title')->getString()

This field is not part of the Media entity definition and so may not exist. When the field does not exist, this causes a fatal error.

Steps to reproduce

Install this module using standard core install profile
Publish a node with a reference to an unpublished media entity

Proposed resolution

Use $media->label()

Remaining tasks

Review & commit

User interface changes

May be a slight UX change for situations with field title does exist

API changes

n/a

Data model changes

n/a

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand ericgsmith

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

Comments & Activities

Production build 0.69.0 2024