Skip to content

Commit 0b5f63f

Browse files
author
Alex Bomko
committed
MAGETWO-47001: Error on import products - validation not works
1 parent c87537d commit 0b5f63f

File tree

1 file changed

+2
-5
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+2
-5
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,16 +1317,13 @@ protected function getExistingImages($images)
13171317
if (!$productMediaGalleryTableName) {
13181318
$productMediaGalleryTableName = $resource->getTable('catalog_product_entity_media_gallery');
13191319
}
1320-
$linkField = $this->metadataPool
1321-
->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class)
1322-
->getLinkField();
13231320
$select = $this->_connection->select()->from(
13241321
['mg' => $resource->getTable('catalog_product_entity_media_gallery')],
13251322
['value' => 'mg.value']
13261323
)->joinLeft(
13271324
['mgvte' => $resource->getTable('catalog_product_entity_media_gallery_value_to_entity')],
13281325
'(mg.value_id = mgvte.value_id)',
1329-
[$linkField => 'mgvte.' . $linkField]
1326+
['entity_id' => 'mgvte.entity_id']
13301327
)->where(
13311328
'mg.value IN(?)',
13321329
$images
@@ -2391,7 +2388,7 @@ protected function checkUrlKeyDuplicates()
23912388
->where('store_id IN (?)', $storeId)
23922389
->where('cpe.sku not in (?)', array_values($urlKeys))
23932390
);
2394-
foreach ($urlKeyDuplicates as $urlKey => $entityData) {
2391+
foreach ($urlKeyDuplicates as $entityData) {
23952392
$rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];
23962393
$this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum);
23972394
}

0 commit comments

Comments
 (0)