You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Magento: 2.1.12
Pimgento: ~100.2.0
I was facing this situation :
I am trying to import 4 images for one product. The temporary pimgento table for media was completed as following :
We can see that there are several lines similar (first 4). If I save in the backoffice Magento the product, the table catalog_product_entity_media_gallery_value is updated and I had :
In fact, the line is duplicated for each attribute ('small_image', 'second_image', etc ...) linked to the image. One solution that I found is to add : $connection->delete($tableMedia, "attribute_id IS NOT NULL"); on the line 391 of vendor/agencednd/module-pimgento/Product/Model/Factory/Import/Media.php
The text was updated successfully, but these errors were encountered:
I tried to import 3 images for one product. And I do not have duplicated lines in the table media_gallery_value.
Can you try to update your Pimgento version and tell me if it works better ?
Hi,
Magento: 2.1.12
Pimgento: ~100.2.0
I was facing this situation :
I am trying to import 4 images for one product. The temporary pimgento table for media was completed as following :
select * from tmp_pimgento_entities_media\G
*************************** 1. row ***************************
sku: 485690
entity_id: 12082
attribute_id: 87
store_id: 0
value_id: 23616
record_id: NULL
media_original: files/485690/media_photo/GTA-GD51NAT.png
media_cleaned: 485690-485690-media_photo-gta-gd51nat.png
media_value: /4/8/485690-485690-media_photo-gta-gd51nat.png
position: 0
id: 1
*************************** 2. row ***************************
sku: 485690
entity_id: 12082
attribute_id: 88
store_id: 0
value_id: 23616
record_id: NULL
media_original: files/485690/media_photo/GTA-GD51NAT.png
media_cleaned: 485690-485690-media_photo-gta-gd51nat.png
media_value: /4/8/485690-485690-media_photo-gta-gd51nat.png
position: 0
id: 2
*************************** 3. row ***************************
sku: 485690
entity_id: 12082
attribute_id: 89
store_id: 0
value_id: 23616
record_id: NULL
media_original: files/485690/media_photo/GTA-GD51NAT.png
media_cleaned: 485690-485690-media_photo-gta-gd51nat.png
media_value: /4/8/485690-485690-media_photo-gta-gd51nat.png
position: 0
id: 3
*************************** 4. row ***************************
sku: 485690
entity_id: 12082
attribute_id: 133
store_id: 0
value_id: 23616
record_id: NULL
media_original: files/485690/media_photo/GTA-GD51NAT.png
media_cleaned: 485690-485690-media_photo-gta-gd51nat.png
media_value: /4/8/485690-485690-media_photo-gta-gd51nat.png
position: 0
id: 4
*************************** 5. row ***************************
sku: 485690
entity_id: 12082
attribute_id: 178
store_id: 0
value_id: 23617
record_id: NULL
media_original: files/485690/media_photo1/GTA-GD51NAT-2.png
media_cleaned: 485690-485690-media_photo1-gta-gd51nat-2.png
media_value: /4/8/485690-485690-media_photo1-gta-gd51nat-2.png
position: 0
id: 5
*************************** 6. row ***************************
sku: 485690
entity_id: 12082
attribute_id: NULL
store_id: 0
value_id: 23616
record_id: NULL
media_original: files/485690/media_photo/GTA-GD51NAT.png
media_cleaned: 485690-485690-media_photo-gta-gd51nat.png
media_value: /4/8/485690-485690-media_photo-gta-gd51nat.png
position: 0
id: 6
*************************** 7. row ***************************
sku: 485690
entity_id: 12082
attribute_id: NULL
store_id: 0
value_id: 23617
record_id: NULL
media_original: files/485690/media_photo1/GTA-GD51NAT-2.png
media_cleaned: 485690-485690-media_photo1-gta-gd51nat-2.png
media_value: /4/8/485690-485690-media_photo1-gta-gd51nat-2.png
position: 1
id: 7
*************************** 8. row ***************************
sku: 485690
entity_id: 12082
attribute_id: NULL
store_id: 0
value_id: 23618
record_id: NULL
media_original: files/485690/media_photo2/GTA-GD51NAT-3.png
media_cleaned: 485690-485690-media_photo2-gta-gd51nat-3.png
media_value: /4/8/485690-485690-media_photo2-gta-gd51nat-3.png
position: 2
id: 8
*************************** 9. row ***************************
sku: 485690
entity_id: 12082
attribute_id: NULL
store_id: 0
value_id: 23619
record_id: NULL
media_original: files/485690/media_photo3/GTA-GD51NAT-4.png
media_cleaned: 485690-485690-media_photo3-gta-gd51nat-4.png
media_value: /4/8/485690-485690-media_photo3-gta-gd51nat-4.png
position: 3
id: 9
And after the media import, I had for the table catalog_product_entity_media_gallery_value :
value_id | store_id | entity_id | label | position | disabled | record_id |
+----------+----------+-----------+-------+----------+----------+-----------+
23644 | 0 | 12082 | | 0 | 0 | 91429 |
| 23644 | 0 | 12082 | | 0 | 0 | 91430 |
| 23644 | 0 | 12082 | | 0 | 0 | 91431 |
| 23644 | 0 | 12082 | | 0 | 0 | 91432 |
| 23645 | 0 | 12082 | | 0 | 0 | 91433 |
| 23644 | 0 | 12082 | | 0 | 0 | 91434 |
| 23645 | 0 | 12082 | | 1 | 0 | 91435 |
| 23646 | 0 | 12082 | | 2 | 0 | 91436 |
| 23647 | 0 | 12082 | | 3 | 0 | 91437 |
We can see that there are several lines similar (first 4). If I save in the backoffice Magento the product, the table catalog_product_entity_media_gallery_value is updated and I had :
value_id | store_id | entity_id | label | position | disabled | record_id |
+----------+----------+-----------+-------+----------+----------+-----------+
| 23644 | 0 | 12082 | | 0 | 0 | 91468 |
| 23645 | 0 | 12082 | | 1 | 0 | 91469 |
| 23646 | 0 | 12082 | | 2 | 0 | 91470 |
| 23647 | 0 | 12082 | | 3 | 0 | 91471 |
In fact, the line is duplicated for each attribute ('small_image', 'second_image', etc ...) linked to the image. One solution that I found is to add :
$connection->delete($tableMedia, "attribute_id IS NOT NULL");
on the line 391 of vendor/agencednd/module-pimgento/Product/Model/Factory/Import/Media.phpThe text was updated successfully, but these errors were encountered: