Skip to content

Commit 5da21fe

Browse files
authored
ENGCOM-4342: [Catalog] Fixing the Products grid with default values on multi stores #21363
2 parents 56b2932 + 6f64793 commit 5da21fe

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/ProductCustomOptionsDataProviderTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ protected function setUp()
5454
->getMockForAbstractClass();
5555
$this->collectionMock = $this->getMockBuilder(AbstractCollection::class)
5656
->disableOriginalConstructor()
57-
->setMethods(['load', 'getSelect', 'getTable', 'getIterator', 'isLoaded', 'toArray', 'getSize'])
57+
->setMethods([
58+
'load',
59+
'getSelect',
60+
'getTable',
61+
'getIterator',
62+
'isLoaded',
63+
'toArray',
64+
'getSize',
65+
'setStoreId'
66+
])
5867
->getMockForAbstractClass();
5968
$this->dbSelectMock = $this->getMockBuilder(DbSelect::class)
6069
->disableOriginalConstructor()

app/code/Magento/Catalog/Ui/DataProvider/Product/ProductDataProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
99
use Magento\Framework\App\ObjectManager;
10+
use Magento\Store\Model\Store;
1011
use Magento\Ui\DataProvider\Modifier\ModifierInterface;
1112
use Magento\Ui\DataProvider\Modifier\PoolInterface;
1213

@@ -67,6 +68,7 @@ public function __construct(
6768
$this->addFieldStrategies = $addFieldStrategies;
6869
$this->addFilterStrategies = $addFilterStrategies;
6970
$this->modifiersPool = $modifiersPool ?: ObjectManager::getInstance()->get(PoolInterface::class);
71+
$this->collection->setStoreId(Store::DEFAULT_STORE_ID);
7072
}
7173

7274
/**
@@ -110,7 +112,7 @@ public function addField($field, $alias = null)
110112
}
111113

112114
/**
113-
* {@inheritdoc}
115+
* @inheritdoc
114116
*/
115117
public function addFilter(\Magento\Framework\Api\Filter $filter)
116118
{

0 commit comments

Comments
 (0)