BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Different behavior on 3.2 and 3.6/3.7 with imagegallery #181

Open betterapp opened 1 week ago

betterapp commented 1 week ago

Hi,

We have a folder where we upload images. Then those images should be added to gallery in Product object. For example, if we upload three images, a dataport processes starts to handle them.

We have code that add images to a gallery like this:

return [
        'query' => 'Image:path:' . $assetFullPath,
    ];

In both versions we have: image

In version 3.2, every time this code ran, a new image would be added to the gallery as expected.

However, in version 3.6/3.7, every time the code runs, it replaces the existing image in the gallery rather than adding a new one. As a result, we're unable to add multiple images.

In both versions, the image data structure is the same.

Issue: In version 3.2, uploading multiple images works fine; each image is added to the gallery. In version 3.6/3.7, when uploading multiple images at once, and multiple dataport instances run in parallel, only the last image from the last instance appears in the gallery. However, if we upload images one by one, waiting for each dataport instance to finish before adding another, it works as expected. So, in versions 3.6/3.7, when multiple images are uploaded and multiple dataport instances run in parallel, only the image from the last completed dataport instance is added to the gallery.

Question: How can we modify the code in version 3.6 (or later) to allow the addition of multiple images to the gallery when uploading several images at once ? Is it not a bug related with optimize saving objects data from parallel dataport instances ?

BlackbitDevs commented 1 week ago

Sounds like edit lock does not work. Can you check table edit_lock during the import and check for records with userId=0.

Are the dataports called with --force (or -f)? Because then the edit lock does not get applied.

betterapp commented 1 week ago

I tried with -f and without. With depenedent dataport wait until finish true/false.

4 tests. The same result. edit_lock is created.

Problem is that 3 different instances try to update the same field ?

Our use case:

We upload 3 images: 1234_1.png 1234_2.png 1234_3.png into one folder

We identify SKU from file name. 1234 = SKU

DD starts 3 different instances. Every instance process one image file.

All those images should be assigned to Product's image gallery but only one (last) is assigned.

3.2 - it is working correct (OK) 3.6>= - NOT OK

betterapp commented 6 days ago

any update ?

betterapp commented 2 days ago

@BlackbitDevs ??

betterapp commented 6 hours ago

@Jan-Walther-Blackbit @BlackbitDevs