Skip to content

Commit 8660485

Browse files
author
An Van den Bosch
committed
Add category to url_key error message
Error message for url_key is not wrong but too short Use addFailedCategory() to add category to error message Issue: 10697
1 parent 0c0393d commit 8660485

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,12 @@ protected function createCategory($name, $parentId)
118118
$category->setIsActive(true);
119119
$category->setIncludeInMenu(true);
120120
$category->setAttributeSetId($category->getDefaultAttributeSetId());
121-
$category->save();
122-
$this->categoriesCache[$category->getId()] = $category;
121+
try {
122+
$category->save();
123+
$this->categoriesCache[$category->getId()] = $category;
124+
} catch (\Exception $e){
125+
$this->addFailedCategory($category, $e);
126+
}
123127

124128
return $category->getId();
125129
}

0 commit comments

Comments
 (0)