Skip to content

Commit

Permalink
MAGETWO-36369: [GitHub] Unable to save product per website wise #1245
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym Aposov committed Jun 11, 2015
1 parent 540b535 commit c17d1f4
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public function getUrlPath($product, $category = null)
$path = $product->getData('url_path');
if ($path === null) {
$path = $product->getUrlKey() === false
? $this->_prepareProductDefaultUrlKey($product)
: $this->_prepareProductUrlKey($product);
? $this->prepareProductDefaultUrlKey($product)
: $this->prepareProductUrlKey($product);
}
return $category === null
? $path
Expand All @@ -73,9 +73,9 @@ public function getUrlPath($product, $category = null)
* Prepare URL Key with stored product data (fallback for "Use Default Value" logic)
*
* @param \Magento\Catalog\Model\Product $product
* @return mixed|null|string
* @return string
*/
protected function _prepareProductDefaultUrlKey(\Magento\Catalog\Model\Product $product)
protected function prepareProductDefaultUrlKey(\Magento\Catalog\Model\Product $product)
{
$storedProduct = $this->productRepository->getById($product->getId());
$storedUrlKey = $storedProduct->getUrlKey();
Expand Down Expand Up @@ -116,7 +116,7 @@ public function getCanonicalUrlPath($product, $category = null)
*/
public function generateUrlKey($product)
{
return $product->getUrlKey() === false ? false : $this->_prepareProductUrlKey($product);
return $product->getUrlKey() === false ? false : $this->prepareProductUrlKey($product);
}

/**
Expand All @@ -125,7 +125,7 @@ public function generateUrlKey($product)
* @param \Magento\Catalog\Model\Product $product
* @return string
*/
protected function _prepareProductUrlKey(\Magento\Catalog\Model\Product $product)
protected function prepareProductUrlKey(\Magento\Catalog\Model\Product $product)
{
$urlKey = $product->getUrlKey();
return $product->formatUrlKey($urlKey === '' || $urlKey === null ? $product->getName() : $urlKey);
Expand Down

0 comments on commit c17d1f4

Please sign in to comment.