Conflict in importing nodes with images from a local system to a live system.

Created on 30 November 2021, almost 3 years ago
Updated 15 March 2023, over 1 year ago

Problem/Motivation

I'm testing the version on the latest developper branch of this module and have this problem:

I have a content type that is in fact a photobook. You can add photos to it.
When I export such a node, the yaml file has for every photo a full path to the url of the photo. In fact, on my local development system it starts with "http://localhost/...".
When I import this node to my live system, I see a conflict off course between the url's of the images. The import says "http://localhost..." and the live machine has "http://www.example.com/...".

In the yaml file of the node of the version 2.1 of this module there was no reference to url but only to the id of the image.
I can send some examples of both versions if needed.

By the way: the version on the branch is now 2bfa12c22b63b35ff1affcc106ea7e2520842cb0
By the way 2: I want to switch to Drupal 9 because version 8 doesn't receives any updates anymore and version 2.1 of this module is not Drupal 9 compatible. (and version 3.0beta1 does not work)

Steps to reproduce

Export a node with images on a local machine and import it on the live server.

Proposed resolution

If the url is needed, it should start after the specification of the server.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇧🇪Belgium ericvl

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.

  • 🇮🇳India prashant.c Dharamshala

    In #7 following is removed

    use Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer;
    

    but the class ImageItemNormalizer extends it.

    class ImageItemNormalizer extends EntityReferenceFieldItemNormalizer 
    
  • 🇧🇪Belgium ericvl

    @Prashant.c
    Yes, it extends from EntityReferenceFieldItemNormalizer but not from the one in core. It should extend from the EntityReferenceFieldItemNormalizer in the same folder (src/Normalizer) of the module. And if you delete the "use" line in the file, it will extends the one in the same folder.
    I think, this was copied from another module, created a new EntityReferenceFieldItemNormalizer in the module and forgotten to delete the original line.
    If you use the patch, it will work.

  • Status changed to Needs review over 1 year ago
Production build 0.71.5 2024