diff --git a/vendor/magento/module-shared-catalog/Plugin/Company/Controller/Adminhtml/Index/IndexPlugin.php b/vendor/magento/module-shared-catalog/Plugin/Company/Controller/Adminhtml/Index/IndexPlugin.php deleted file mode 100644 index 58d9b07836ad..000000000000 --- a/vendor/magento/module-shared-catalog/Plugin/Company/Controller/Adminhtml/Index/IndexPlugin.php +++ /dev/null @@ -1,61 +0,0 @@ -messageManager = $messageManager; - $this->urlBuilder = $urlBuilder; - $this->sharedCatalogManagement = $sharedCatalogManagement; - } - - /** - * Before index controller execute - * - * @param \Magento\Company\Controller\Adminhtml\Index\Index $subject - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function beforeExecute(\Magento\Company\Controller\Adminhtml\Index\Index $subject) - { - if (!$this->sharedCatalogManagement->isPublicCatalogExist()) { - $this->messageManager->addError( - __( - 'Please create at least a public shared catalog to proceed.', - $this->urlBuilder->getUrl('shared_catalog/sharedCatalog/create') - ) - ); - } - } -} diff --git a/vendor/magento/module-shared-catalog/Plugin/SharedCatalog/CollectionFilter.php b/vendor/magento/module-shared-catalog/Plugin/SharedCatalog/CollectionFilter.php index e427a40c44ad..d66d4d0861c1 100644 --- a/vendor/magento/module-shared-catalog/Plugin/SharedCatalog/CollectionFilter.php +++ b/vendor/magento/module-shared-catalog/Plugin/SharedCatalog/CollectionFilter.php @@ -161,13 +161,17 @@ private function filterSharedCatalogsByAllowedStoreGroupIdsAndAdminUser(Collecti $adminUserId = $this->getAdminId(); //filter by allowed store group ids when store_id is assigned to shared catalog, //or by created_by for shared catalog without assigned store group - $collection->getSelect() - ->where('main_table.store_id IN (?)', $allowedStoreGroupIds, \Zend_Db::INT_TYPE) - ->orWhere( - '(main_table.store_id IS NULL AND main_table.created_by = ?)', - $adminUserId, - \Zend_Db::INT_TYPE - ); + $collection->addFieldToFilter( + [ + 'main_table.store_id', + 'main_table.created_by' + ], + [ + ['in' => array_map(fn($value) => (int)$value, $allowedStoreGroupIds)], + // OR + ['eq' => (int)$adminUserId] + ] + ); } } diff --git a/vendor/magento/module-shared-catalog/etc/di.xml b/vendor/magento/module-shared-catalog/etc/di.xml index 98293d0c8635..77ae7eef6b3b 100644 --- a/vendor/magento/module-shared-catalog/etc/di.xml +++ b/vendor/magento/module-shared-catalog/etc/di.xml @@ -92,10 +92,6 @@ \Magento\SharedCatalog\Api\SharedCatalogRepositoryInterface\Proxy - - - - diff --git a/vendor/magento/module-shared-catalog/view/adminhtml/ui_component/company_listing.xml b/vendor/magento/module-shared-catalog/view/adminhtml/ui_component/company_listing.xml index e88c7b835f22..3850419c7483 100644 --- a/vendor/magento/module-shared-catalog/view/adminhtml/ui_component/company_listing.xml +++ b/vendor/magento/module-shared-catalog/view/adminhtml/ui_component/company_listing.xml @@ -6,13 +6,6 @@ */ --> - - - - -