Closed
Description
When I use the Magento default csv product import with an url_key
field the value is not formatted/translit before being inserted into the database. This way I end up with spaces in the url key field. The rest of the system works ok with this except GraphQL which will output the url_key
field directly from the database.
Preconditions (*)
Magento 2.4.2 and probably all versions below.
Steps to reproduce (*)
- Create a product with sku: ABC
- Import csv below:
"sku", "url_key"
"ABC", "Test ABC 1 2 3"
Expected result (*)
url_key
attribute being:test-abc-1-2-3
Actual result (*)
url_key
attribute being:test abc 1 2 3
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
Patch
--- vendor/magento/module-catalog-import-export/Model/Import/Product.php
+++ vendor/magento/module-catalog-import-export/Model/Import/Product.php
@@ -3011,7 +3011,7 @@
{
if (!empty($rowData[self::URL_KEY])) {
$urlKey = (string) $rowData[self::URL_KEY];
- return trim(strtolower($urlKey));
+ return $this->productUrl->formatUrlKey($urlKey);
}
if (!empty($rowData[self::COL_NAME])
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done