Skip to content

Commit e61b23a

Browse files
MAGETWO-91559: Static blocks with same ID appear in place of correct block
- Fix static test
1 parent 8929a0e commit e61b23a

File tree

1 file changed

+7
-3
lines changed
  • app/code/Magento/Cms/Model/ResourceModel

1 file changed

+7
-3
lines changed

app/code/Magento/Cms/Model/ResourceModel/Block.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ protected function _beforeSave(AbstractModel $object)
9595
}
9696

9797
/**
98+
* Get block id.
99+
*
98100
* @param AbstractModel $object
99101
* @param mixed $value
100-
* @param null $field
102+
* @param string $field
101103
* @return bool|int|string
102104
* @throws LocalizedException
103105
* @throws \Exception
@@ -187,7 +189,7 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
187189
$isDefaultStore = $this->_storeManager->isSingleStoreMode()
188190
|| array_search(Store::DEFAULT_STORE_ID, $stores) !== false;
189191

190-
if(!$isDefaultStore) {
192+
if (!$isDefaultStore) {
191193
$stores[] = Store::DEFAULT_STORE_ID;
192194
}
193195

@@ -200,7 +202,7 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
200202
)
201203
->where('cb.identifier = ? ', $object->getData('identifier'));
202204

203-
if(!$isDefaultStore) {
205+
if (!$isDefaultStore) {
204206
$select->where('cbs.store_id IN (?)', $stores);
205207
}
206208

@@ -241,6 +243,8 @@ public function lookupStoreIds($id)
241243
}
242244

243245
/**
246+
* Save an object.
247+
*
244248
* @param AbstractModel $object
245249
* @return $this
246250
* @throws \Exception

0 commit comments

Comments
 (0)