Skip to content
Snippets Groups Projects
Commit b2505793 authored by Vlad Veselov's avatar Vlad Veselov
Browse files

MAGETWO-84955: Set Current Store from Store Code if isUseStoreInUrl #12529

 - Merge Pull Request magento/magento2#12529 from osrecio/magento2:PR#12450_2.2
 - Merged commits:
   1. ff0e2018
parents 9eb883d8 ff0e2018
No related merge requests found
...@@ -44,7 +44,7 @@ class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProces ...@@ -44,7 +44,7 @@ class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProces
if ($store->isUseStoreInUrl()) { if ($store->isUseStoreInUrl()) {
if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE) { if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE) {
$this->storeManager->setCurrentStore($storeCode); $this->storeManager->setCurrentStore($store->getCode());
$pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : ''); $pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
return $pathInfo; return $pathInfo;
} elseif (!empty($storeCode)) { } elseif (!empty($storeCode)) {
......
...@@ -47,6 +47,7 @@ class PathInfoProcessorTest extends \PHPUnit\Framework\TestCase ...@@ -47,6 +47,7 @@ class PathInfoProcessorTest extends \PHPUnit\Framework\TestCase
)->with( )->with(
'storeCode' 'storeCode'
)->willReturn($store); )->willReturn($store);
$store->expects($this->once())->method('getCode')->will($this->returnValue('storeCode'));
$store->expects($this->once())->method('isUseStoreInUrl')->will($this->returnValue(true)); $store->expects($this->once())->method('isUseStoreInUrl')->will($this->returnValue(true));
$this->_requestMock->expects( $this->_requestMock->expects(
$this->once() $this->once()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment