|
| 1 | +diff --git a/vendor/magento/module-store/App/FrontController/Plugin/DefaultStore.php b/vendor/magento/module-store/App/FrontController/Plugin/DefaultStore.php |
| 2 | +deleted file mode 100644 |
| 3 | +index 58340c6cc35..00000000000 |
| 4 | +--- a/vendor/magento/module-store/App/FrontController/Plugin/DefaultStore.php |
| 5 | ++++ /dev/null |
| 6 | +@@ -1,73 +0,0 @@ |
| 7 | +-<?php |
| 8 | +-/** |
| 9 | +- * Copyright © Magento, Inc. All rights reserved. |
| 10 | +- * See COPYING.txt for license details. |
| 11 | +- */ |
| 12 | +-namespace Magento\Store\App\FrontController\Plugin; |
| 13 | +- |
| 14 | +-use \Magento\Store\Model\StoreResolver\ReaderList; |
| 15 | +-use \Magento\Store\Model\ScopeInterface; |
| 16 | +- |
| 17 | +-/** |
| 18 | +- * Plugin to set default store for admin area. |
| 19 | +- */ |
| 20 | +-class DefaultStore |
| 21 | +-{ |
| 22 | +- /** |
| 23 | +- * @var \Magento\Store\Model\StoreManagerInterface |
| 24 | +- */ |
| 25 | +- protected $storeManager; |
| 26 | +- |
| 27 | +- /** |
| 28 | +- * @var ReaderList |
| 29 | +- */ |
| 30 | +- protected $readerList; |
| 31 | +- |
| 32 | +- /** |
| 33 | +- * @var string |
| 34 | +- */ |
| 35 | +- protected $runMode; |
| 36 | +- |
| 37 | +- /** |
| 38 | +- * @var string |
| 39 | +- */ |
| 40 | +- protected $scopeCode; |
| 41 | +- |
| 42 | +- /** |
| 43 | +- * Initialize dependencies. |
| 44 | +- * |
| 45 | +- * @param \Magento\Store\Model\StoreManagerInterface $storeManager |
| 46 | +- * @param ReaderList $readerList |
| 47 | +- * @param string $runMode |
| 48 | +- * @param null $scopeCode |
| 49 | +- */ |
| 50 | +- public function __construct( |
| 51 | +- \Magento\Store\Model\StoreManagerInterface $storeManager, |
| 52 | +- ReaderList $readerList, |
| 53 | +- $runMode = ScopeInterface::SCOPE_STORE, |
| 54 | +- $scopeCode = null |
| 55 | +- ) { |
| 56 | +- $this->runMode = $scopeCode ? $runMode : ScopeInterface::SCOPE_WEBSITE; |
| 57 | +- $this->scopeCode = $scopeCode; |
| 58 | +- $this->readerList = $readerList; |
| 59 | +- $this->storeManager = $storeManager; |
| 60 | +- } |
| 61 | +- |
| 62 | +- /** |
| 63 | +- * Set current store for admin area |
| 64 | +- * |
| 65 | +- * @param \Magento\Framework\App\FrontController $subject |
| 66 | +- * @param \Magento\Framework\App\RequestInterface $request |
| 67 | +- * @return void |
| 68 | +- * |
| 69 | +- * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
| 70 | +- */ |
| 71 | +- public function beforeDispatch( |
| 72 | +- \Magento\Framework\App\FrontController $subject, |
| 73 | +- \Magento\Framework\App\RequestInterface $request |
| 74 | +- ) { |
| 75 | +- $reader = $this->readerList->getReader($this->runMode); |
| 76 | +- $defaultStoreId = $reader->getDefaultStoreId($this->scopeCode); |
| 77 | +- $this->storeManager->setCurrentStore($defaultStoreId); |
| 78 | +- } |
| 79 | +-} |
| 80 | +diff --git a/vendor/magento/module-store/etc/adminhtml/di.xml b/vendor/magento/module-store/etc/adminhtml/di.xml |
| 81 | +index e6e21f6ec0a..26fcbad0ff1 100644 |
| 82 | +--- a/vendor/magento/module-store/etc/adminhtml/di.xml |
| 83 | ++++ b/vendor/magento/module-store/etc/adminhtml/di.xml |
| 84 | +@@ -6,9 +6,6 @@ |
| 85 | + */ |
| 86 | + --> |
| 87 | + <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> |
| 88 | +- <type name="Magento\Framework\App\FrontControllerInterface"> |
| 89 | +- <plugin name="default_store_setter" type="Magento\Store\App\FrontController\Plugin\DefaultStore" /> |
| 90 | +- </type> |
| 91 | + <type name="Magento\Framework\Notification\MessageList"> |
| 92 | + <arguments> |
| 93 | + <argument name="messages" xsi:type="array"> |
| 94 | +diff --git a/vendor/magento/module-store/etc/di.xml b/vendor/magento/module-store/etc/di.xml |
| 95 | +index 984a16eb349..643550ac9f8 100644 |
| 96 | +--- a/vendor/magento/module-store/etc/di.xml |
| 97 | ++++ b/vendor/magento/module-store/etc/di.xml |
| 98 | +@@ -115,12 +115,6 @@ |
| 99 | + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> |
| 100 | + </arguments> |
| 101 | + </type> |
| 102 | +- <type name="Magento\Store\App\FrontController\Plugin\DefaultStore"> |
| 103 | +- <arguments> |
| 104 | +- <argument name="runMode" xsi:type="init_parameter">Magento\Store\Model\StoreManager::PARAM_RUN_TYPE</argument> |
| 105 | +- <argument name="scopeCode" xsi:type="init_parameter">Magento\Store\Model\StoreManager::PARAM_RUN_CODE</argument> |
| 106 | +- </arguments> |
| 107 | +- </type> |
| 108 | + <virtualType name="Magento\Store\Model\ResourceModel\Group\Collection\FetchStrategy" type="Magento\Framework\Data\Collection\Db\FetchStrategy\Cache"> |
| 109 | + <arguments> |
| 110 | + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Collection</argument> |
0 commit comments