form display error with cshs widget without undefined parent

Created on 25 April 2024, 7 months ago

Problem/Motivation

Drupal\cshs\Plugin\Field\FieldWidget\CshsWidget::getTranslationFromContext(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given

Steps to reproduce

  1. Start with content that utilizes a field of taxonomy type, with the "cshs" widget enabled.
  2. Add a parent term from a taxonomy vocabulary to the content.
  3. Next, directly delete the parent term from the taxonomy, causing the parent term's ID to no longer exist in the widget.
  4. Return to the form display of the content.

Proposed resolution

Add condition if entity is null

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024