Skip to content

Commit 8bc2006

Browse files
committed
MAGETWO-85026: [Backport 2.3] #12450: Set Current Store from Store Code if isUseStoreInUrl #12545
- Merge Pull Request #12545 from osrecio/magento2:PR#12450_2.3 - Merged commits: 1. e9bbe2f
2 parents f93b914 + e9bbe2f commit 8bc2006

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
@@ -43,7 +43,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI
4343

4444
if ($store->isUseStoreInUrl()) {
4545
if (!$request->isDirectAccessFrontendName($storeCode)) {
46-
$this->storeManager->setCurrentStore($storeCode);
46+
$this->storeManager->setCurrentStore($store->getCode());
4747
$pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
4848
return $pathInfo;
4949
} 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)