Skip to content

Commit

Permalink
MAGETWO-84955: Set Current Store from Store Code if isUseStoreInUrl #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksii Korshenko authored Dec 11, 2017
2 parents 7412e61 + b250579 commit 76b16b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/Magento/Store/App/Request/PathInfoProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI

if ($store->isUseStoreInUrl()) {
if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE) {
$this->storeManager->setCurrentStore($storeCode);
$this->storeManager->setCurrentStore($store->getCode());
$pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
return $pathInfo;
} elseif (!empty($storeCode)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function testProcessIfStoreExistsAndIsNotDirectAcccessToFrontName()
)->with(
'storeCode'
)->willReturn($store);
$store->expects($this->once())->method('getCode')->will($this->returnValue('storeCode'));
$store->expects($this->once())->method('isUseStoreInUrl')->will($this->returnValue(true));
$this->_requestMock->expects(
$this->once()
Expand Down

0 comments on commit 76b16b3

Please sign in to comment.