Issue with first time saving the image caption of an image field. ( Paragraph )

Created on 25 November 2020, about 4 years ago
Updated 3 May 2023, over 1 year ago

Problem/Motivation

Steps to reproduce

Create a content type ( or use an existing one ) . Add a field entity reference that uses paragraphs. In the Paragraph, use a field_image that has captions enabled from the field settings. Save the changes. Then try to add a new content of this content type, insert the image, insert the image caption. Upon saving the content , the field caption will not be saved.

Proposed resolution

Create a function that does not require revision_id for checking the caption existence ( since in the database is one row per entity_type, entity_id, delta, language ) . Alter the function "image_field_caption_entity_update" in the .module file, to check firstly if the caption exists, and only then to delete it, if not move further to adding ( inserting ) the caption into the database table.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇲🇩Moldova PushaMD

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