diff --git a/app/code/Magento/Widget/Model/ResourceModel/Layout/Update.php b/app/code/Magento/Widget/Model/ResourceModel/Layout/Update.php index 6c0aef9e67186..971a7423f266a 100644 --- a/app/code/Magento/Widget/Model/ResourceModel/Layout/Update.php +++ b/app/code/Magento/Widget/Model/ResourceModel/Layout/Update.php @@ -84,9 +84,7 @@ public function fetchUpdatesByHandle( */ protected function _getFetchUpdatesByHandleSelect($loadAllUpdates = false) { - //@todo Why it also loads layout updates for store_id=0, isn't it Admin Store View? - //If 0 means 'all stores' why it then refers by foreign key to Admin in `store` and not to something named - // 'All Stores'? + // When `store_id = 0`, it applies to "all stores," including the Admin Store View. $select = $this->getConnection()->select()->from( ['layout_update' => $this->getMainTable()], @@ -96,7 +94,7 @@ protected function _getFetchUpdatesByHandleSelect($loadAllUpdates = false) 'link.layout_update_id=layout_update.layout_update_id', '' )->where( - 'link.store_id IN (0, :store_id)' + 'link.store_id = 0 OR link.store_id = :store_id' )->where( 'link.theme_id = :theme_id' )->order(