It is no longer possible to add multiple field states

Created on 10 August 2023, over 1 year ago
Updated 19 April 2024, 8 months ago

Problem/Motivation

It is no longer possible to add multiple field states. It's no longer possible to add multiple field states. Adding one and saving, then attempting to add a second, results in an unusual behavior where only the second state is added, and its display appears broken.

Steps to reproduce

- Create a content type with two fields: One of type "Reference to a taxonomy" and another of type "Reference to a media"
- On the "Reference to a media" field, add a "Disabled" field state to the "Reference to a taxonomy" field with a value-based comparison.
- On the "Reference to a media" field, add an "Invisible" field state to the "Reference to a taxonomy" field with a value-based comparison.
- Result: We end up with the "Invisible" field duplicated, with the first one being malformed since it lacks even the comparison information.

Proposed resolution

While debugging, I realized that the UUID was no longer being created/updated, and as a result, there was an issue in building the array. The problem originates from the setConfiguration() method in FieldStateBase.php, where the ternary condition on $this->uuid is incorrect. Just a slight modification to this condition is needed to restore everything to its previous functionality.

🐛 Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

🇫🇷France bakop Lille

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

Comments & Activities

Production build 0.71.5 2024