If field is disabled on form display data is lost

Created on 23 July 2021, over 3 years ago
Updated 25 May 2023, over 1 year ago

Problem/Motivation

I'm working on a content type with different form displays. One specifically for workflow. When using a form display that doesn't include a field that has image_field_caption the caption data is lost.

Steps to reproduce

Save an entity with image_field_caption data. Update the form display and move the field that has caption data to disabled. Now edit and save the entity again. The data is lost.

Proposed resolution

When testing I noticed that the code checks for $value['image_field_caption']['value']. That is not available when the field is disabled because it is attached to the field widget. But $value['caption'] and $value['caption_format'] look like they are still there.

Remaining tasks

Come up with a proper solution.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Nathaniel

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.

  • πŸ‡©πŸ‡ͺGermany e5sego

    After some testing it seems a cache issue. Image captions which seemed to be lost (booth in view or edit node mode) re-appeared after cache clear.

Production build 0.71.5 2024