From 49074ffd79501c4686819b47117ee11803233131 Mon Sep 17 00:00:00 2001 From: Thiago Lima Date: Fri, 27 Oct 2017 10:25:03 +0200 Subject: [PATCH 1/2] #8236 FIX CMS blocks --- app/code/Magento/Cms/Model/ResourceModel/Block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Model/ResourceModel/Block.php b/app/code/Magento/Cms/Model/ResourceModel/Block.php index 1ea63241dbdee..e7761eb61b3d7 100644 --- a/app/code/Magento/Cms/Model/ResourceModel/Block.php +++ b/app/code/Magento/Cms/Model/ResourceModel/Block.php @@ -186,7 +186,7 @@ public function getIsUniqueBlockToStores(AbstractModel $object) if ($this->_storeManager->hasSingleStore()) { $stores = [Store::DEFAULT_STORE_ID]; } else { - $stores = (array)$object->getData('stores'); + $stores = (array)$object->getData('store_id'); } $select = $this->getConnection()->select() From 2f1c66c20aec82d1e37a1d7b50705350a4126b5d Mon Sep 17 00:00:00 2001 From: Thiago Lima Date: Mon, 30 Oct 2017 17:40:12 +0100 Subject: [PATCH 2/2] Changed Validation to get store for block #11601 --- app/code/Magento/Cms/Model/ResourceModel/Block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Model/ResourceModel/Block.php b/app/code/Magento/Cms/Model/ResourceModel/Block.php index e7761eb61b3d7..40112d8c1971c 100644 --- a/app/code/Magento/Cms/Model/ResourceModel/Block.php +++ b/app/code/Magento/Cms/Model/ResourceModel/Block.php @@ -183,7 +183,7 @@ public function getIsUniqueBlockToStores(AbstractModel $object) $entityMetadata = $this->metadataPool->getMetadata(BlockInterface::class); $linkField = $entityMetadata->getLinkField(); - if ($this->_storeManager->hasSingleStore()) { + if ($this->_storeManager->isSingleStoreMode()) { $stores = [Store::DEFAULT_STORE_ID]; } else { $stores = (array)$object->getData('store_id'); @@ -230,7 +230,7 @@ public function lookupStoreIds($id) 'cbs.' . $linkField . ' = cb.' . $linkField, [] ) - ->where('cb.' . $entityMetadata->getIdentifierField() . ' = :block_id'); + ->where('cb.' . $entityMetadata->getIdentifierField() . ' = :block_id'); return $connection->fetchCol($select, ['block_id' => (int)$id]); }