Do not store file url in the exported yaml if uri is present

Created on 27 February 2025, 3 months ago

Problem/Motivation

Now when we export files, we store the file path in two ways, like this:

custom_fields:
  field_image:
    -
      uri: 'public://2025-02/my-file.jpg'
      url: 'http://my-project.localhost/sites/default/files/2025-02/my-file.jpg'
      alt: 'My file'
      title: ''

But storing URLs with local hosts like 'http://my-project.localhost/' doesn't make sense, because it will be 100% unavailable on another environment where we import the content.

Steps to reproduce

1. Export a node with an image, attached to the field_image field.

2. See the url path in the exported YAML file.

Proposed resolution

I think when we successfully exported the file to the "assets" directory, it is not needed to save the "url" field to the exported yaml, because the file will be available.

So, store the "url" only when we can't save the file locally.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.4

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

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

Comments & Activities

Production build 0.71.5 2024