Skip to content

Commit c93e76d

Browse files
author
Maksym Aposov
committed
MAGETWO-36369: [GitHub] Unable to save product per website wise #1245
1 parent e3988d3 commit c93e76d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getUrlPath($product, $category = null)
7777
*/
7878
protected function _prepareProductDefaultUrlKey(\Magento\Catalog\Model\Product $product)
7979
{
80-
$storedProduct = $this->productRepository->getById($product->getId(), false, Store::DEFAULT_STORE_ID, true);
80+
$storedProduct = $this->productRepository->getById($product->getId(), false, Store::DEFAULT_STORE_ID);
8181
$storedUrlKey = $storedProduct->getUrlKey();
8282
return $storedUrlKey ?: $product->formatUrlKey($storedProduct->getName());
8383
}
@@ -116,10 +116,7 @@ public function getCanonicalUrlPath($product, $category = null)
116116
*/
117117
public function generateUrlKey($product)
118118
{
119-
if ($product->getUrlKey() === false) {
120-
return false;
121-
}
122-
return $this->_prepareProductUrlKey($product);
119+
return $product->getUrlKey() === false ? false : $this->_prepareProductUrlKey($product);
123120
}
124121

125122
/**

0 commit comments

Comments
 (0)