Skip to content

Commit b250579

Browse files
committed
MAGETWO-84955: Set Current Store from Store Code if isUseStoreInUrl #12529
- Merge Pull Request #12529 from osrecio/magento2:PR#12450_2.2 - Merged commits: 1. ff0e201
2 parents 9eb883d + ff0e201 commit b250579

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/code/Magento/Store/App/Request/PathInfoProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI
4444

4545
if ($store->isUseStoreInUrl()) {
4646
if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE) {
47-
$this->storeManager->setCurrentStore($storeCode);
47+
$this->storeManager->setCurrentStore($store->getCode());
4848
$pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
4949
return $pathInfo;
5050
} elseif (!empty($storeCode)) {

app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function testProcessIfStoreExistsAndIsNotDirectAcccessToFrontName()
4747
)->with(
4848
'storeCode'
4949
)->willReturn($store);
50+
$store->expects($this->once())->method('getCode')->will($this->returnValue('storeCode'));
5051
$store->expects($this->once())->method('isUseStoreInUrl')->will($this->returnValue(true));
5152
$this->_requestMock->expects(
5253
$this->once()

0 commit comments

Comments
 (0)