File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
app/code/Magento/Cms/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -183,10 +183,12 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
183
183
$ entityMetadata = $ this ->metadataPool ->getMetadata (BlockInterface::class);
184
184
$ linkField = $ entityMetadata ->getLinkField ();
185
185
186
- if ($ this ->_storeManager ->isSingleStoreMode ()) {
187
- $ stores = [Store::DEFAULT_STORE_ID ];
188
- } else {
189
- $ stores = (array )$ object ->getData ('store_id ' );
186
+ $ stores = (array )$ object ->getData ('store_id ' );
187
+ $ isDefaultStore = $ this ->_storeManager ->isSingleStoreMode ()
188
+ || array_search (Store::DEFAULT_STORE_ID , $ stores ) !== false ;
189
+
190
+ if (!$ isDefaultStore ) {
191
+ $ stores [] = Store::DEFAULT_STORE_ID ;
190
192
}
191
193
192
194
$ select = $ this ->getConnection ()->select ()
@@ -196,8 +198,11 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
196
198
'cb. ' . $ linkField . ' = cbs. ' . $ linkField ,
197
199
[]
198
200
)
199
- ->where ('cb.identifier = ? ' , $ object ->getData ('identifier ' ))
200
- ->where ('cbs.store_id IN (?) ' , $ stores );
201
+ ->where ('cb.identifier = ? ' , $ object ->getData ('identifier ' ));
202
+
203
+ if (!$ isDefaultStore ) {
204
+ $ select ->where ('cbs.store_id IN (?) ' , $ stores );
205
+ }
201
206
202
207
if ($ object ->getId ()) {
203
208
$ select ->where ('cb. ' . $ entityMetadata ->getIdentifierField () . ' <> ? ' , $ object ->getId ());
You can’t perform that action at this time.
0 commit comments