Skip to content

Commit fffb6ff

Browse files
Simplified logic of isNeedToValidateUrlKey to trust logic from getUrlKey
1 parent 7df4e12 commit fffb6ff

File tree

1 file changed

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

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,17 +2409,9 @@ public function validateRow(array $rowData, $rowNum)
24092409
*/
24102410
private function isNeedToValidateUrlKey($rowData)
24112411
{
2412-
/**
2413-
* If the product exists, assume it already has a URL Key and even
2414-
* if a name is provided in the import data, it should not be used
2415-
* to overwrite that existing URL Key the product already has.
2416-
*/
2417-
$isSkuExist = $this->isSkuExist($rowData[self::COL_SKU]);
2418-
if ($isSkuExist && !array_key_exists(self::URL_KEY, $rowData)) {
2419-
return false;
2420-
}
2412+
$urlKey = $this->getUrlKey($rowData);
24212413

2422-
return (!empty($rowData[self::URL_KEY]) || !empty($rowData[self::COL_NAME]))
2414+
return (!empty($urlKey))
24232415
&& (empty($rowData[self::COL_VISIBILITY])
24242416
|| $rowData[self::COL_VISIBILITY]
24252417
!== (string)Visibility::getOptionArray()[Visibility::VISIBILITY_NOT_VISIBLE]);

0 commit comments

Comments
 (0)