From ac0406cb7b2f09bbfe15bce9546d79eea57d546c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sylvain=20Raye=CC=81?= Date: Sat, 14 Oct 2017 15:01:07 +0200 Subject: [PATCH 1/2] [ISSUE-11140][BUGFIX] Skip store code admin from being detected in case of store code in url configured --- app/code/Magento/Store/App/Request/PathInfoProcessor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php index ebea50588f9e5..9a09b78129a54 100644 --- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php +++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php @@ -6,6 +6,7 @@ namespace Magento\Store\App\Request; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Model\Store; class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProcessorInterface { @@ -42,7 +43,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI } if ($store->isUseStoreInUrl()) { - if (!$request->isDirectAccessFrontendName($storeCode)) { + if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE ) { $this->storeManager->setCurrentStore($storeCode); $pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : ''); return $pathInfo; From 6ebf3cecfd06658f4da6a695c56d06c57bb59d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sylvain=20Ray=C3=A9?= Date: Sun, 15 Oct 2017 10:52:55 +0200 Subject: [PATCH 2/2] Update PathInfoProcessor.php Prevent PHPCBF Error --- app/code/Magento/Store/App/Request/PathInfoProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php index 9a09b78129a54..a38ea6d1272e8 100644 --- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php +++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php @@ -43,7 +43,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI } if ($store->isUseStoreInUrl()) { - if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE ) { + if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE) { $this->storeManager->setCurrentStore($storeCode); $pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : ''); return $pathInfo;