From 87bb47e96659687e92d86d54eaa4a5c131e1f22a Mon Sep 17 00:00:00 2001 From: Roman Kabanov Date: Wed, 18 Sep 2019 18:38:38 +0300 Subject: [PATCH] Clean scope code resolver when starting environment emulation --- Helper/Data.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Helper/Data.php b/Helper/Data.php index 4d1ba0e9c..503db7596 100755 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -14,6 +14,7 @@ use Magento\Catalog\Model\ResourceModel\Product\Collection; use Magento\CatalogInventory\Api\StockRegistryInterface; use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeCodeResolver; use Magento\Framework\App\ResourceConnection; use Magento\Framework\Event\ManagerInterface; use Magento\Search\Model\Query; @@ -36,6 +37,7 @@ class Data private $emulation; private $resource; private $eventManager; + private $scopeCodeResolver; private $storeManager; private $emulationRuns = false; @@ -53,6 +55,7 @@ public function __construct( Logger $logger, ResourceConnection $resource, ManagerInterface $eventManager, + ScopeCodeResolver $scopeCodeResolver, StoreManagerInterface $storeManager ) { $this->algoliaHelper = $algoliaHelper; @@ -69,6 +72,7 @@ public function __construct( $this->emulation = $emulation; $this->resource = $resource; $this->eventManager = $eventManager; + $this->scopeCodeResolver = $scopeCodeResolver; $this->storeManager = $storeManager; } @@ -676,6 +680,7 @@ public function startEmulation($storeId) $this->logger->start('START EMULATION'); $this->emulation->startEnvironmentEmulation($storeId, Area::AREA_FRONTEND, true); + $this->scopeCodeResolver->clean(); $this->emulationRuns = true; $this->logger->stop('START EMULATION');