Images are not well imported on text fields

Created on 22 March 2023, almost 2 years ago

Problem/Motivation

Hello,
I face a problem when I try to import a node which have long textfield with multiple images. Only the last image was imported on the new site, even if the images are present in the archive.

Steps to reproduce

  • Create a content type with a longtext field.
  • Create a node of this content type, add 2 images on the longtext field.
  • Export it.
  • Import on another website (or remove physically both images before import).

You will see that only the second image was imported.
The image are correctly saved on the archive. But when we look on the field array in the node.json we can see that "included_image" is a string and only contain the last fileGID.

Proposed resolution

My solution is to transform "included_image" string into array. I already made a patch about it.

I keep the is_array check on the import to preserve backward compatibility with older export. Maybe it's a better idea to remove it.

🐛 Bug report
Status

Active

Version

3.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