Skip to content

Commit e9300b7

Browse files
committed
#26499 Always transliterate product url key
1 parent 3811867 commit e9300b7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function prepareProductUrlKey(Product $product)
150150
$urlKey = (string)$product->getUrlKey();
151151
$urlKey = trim(strtolower($urlKey));
152152

153-
return $urlKey ?: $product->formatUrlKey($product->getName());
153+
return $product->formatUrlKey($urlKey ?: $product->getName());
154154
}
155155

156156
/**

app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ protected function setUp(): void
8080
public function getUrlPathDataProvider(): array
8181
{
8282
return [
83-
'path based on url key uppercase' => ['Url-Key', null, 0, 'url-key'],
84-
'path based on url key' => ['url-key', null, 0, 'url-key'],
83+
'path based on url key uppercase' => ['Url-Key', null, 1, 'url-key'],
84+
'path based on url key' => ['url-key', null, 1, 'url-key'],
8585
'path based on product name 1' => ['', 'product-name', 1, 'product-name'],
8686
'path based on product name 2' => [null, 'product-name', 1, 'product-name'],
8787
'path based on product name 3' => [false, 'product-name', 1, 'product-name']

0 commit comments

Comments
 (0)