Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 3483dd5

Browse files
committed
MAGETWO-91608: SEO-friendly URL for category page not working
1 parent ce5fead commit 3483dd5

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,6 @@ public function __construct(
3838
parent::__construct($context);
3939
}
4040

41-
/**
42-
* Resolve store id
43-
*
44-
* Tries to take store id from store HTTP parameter
45-
* @see Store
46-
*
47-
* @return int
48-
*/
49-
private function resolveStoreId() : int
50-
{
51-
return (int) $this->getRequest()->getParam('store', Store::DEFAULT_STORE_ID);
52-
}
53-
5441
/**
5542
* Initialize requested category and put it into registry.
5643
* Root category can be returned, if inappropriate store/category is specified
@@ -87,7 +74,7 @@ protected function _initCategory($getRootInstead = false)
8774
$this->_objectManager->get(\Magento\Framework\Registry::class)->register('category', $category);
8875
$this->_objectManager->get(\Magento\Framework\Registry::class)->register('current_category', $category);
8976
$this->_objectManager->get(\Magento\Cms\Model\Wysiwyg\Config::class)
90-
->setStoreId($this->getRequest()->getParam('store'));
77+
->setStoreId($storeId);
9178
return $category;
9279
}
9380

@@ -96,13 +83,28 @@ protected function _initCategory($getRootInstead = false)
9683
*
9784
* @return int
9885
*/
99-
private function resolveCategoryId()
86+
private function resolveCategoryId() : int
10087
{
10188
$categoryId = (int)$this->getRequest()->getParam('id', false);
10289

10390
return $categoryId ?: (int)$this->getRequest()->getParam('entity_id', false);
10491
}
10592

93+
/**
94+
* Resolve store id
95+
*
96+
* Tries to take store id from store HTTP parameter
97+
* @see Store
98+
*
99+
* @return int
100+
*/
101+
private function resolveStoreId() : int
102+
{
103+
$storeId = (int)$this->getRequest()->getParam('store', false);
104+
105+
return $storeId ?: (int)$this->getRequest()->getParam('store_id', Store::DEFAULT_STORE_ID);
106+
}
107+
106108
/**
107109
* Build response for ajax request
108110
*

0 commit comments

Comments
 (0)