Skip to content

Commit

Permalink
ENGCOM-4342: [Catalog] Fixing the Products grid with default values o…
Browse files Browse the repository at this point in the history
…n multi stores #21363
  • Loading branch information
sivaschenko authored Mar 4, 2019
2 parents 56b2932 + 6f64793 commit 5da21fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ protected function setUp()
->getMockForAbstractClass();
$this->collectionMock = $this->getMockBuilder(AbstractCollection::class)
->disableOriginalConstructor()
->setMethods(['load', 'getSelect', 'getTable', 'getIterator', 'isLoaded', 'toArray', 'getSize'])
->setMethods([
'load',
'getSelect',
'getTable',
'getIterator',
'isLoaded',
'toArray',
'getSize',
'setStoreId'
])
->getMockForAbstractClass();
$this->dbSelectMock = $this->getMockBuilder(DbSelect::class)
->disableOriginalConstructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Framework\App\ObjectManager;
use Magento\Store\Model\Store;
use Magento\Ui\DataProvider\Modifier\ModifierInterface;
use Magento\Ui\DataProvider\Modifier\PoolInterface;

Expand Down Expand Up @@ -67,6 +68,7 @@ public function __construct(
$this->addFieldStrategies = $addFieldStrategies;
$this->addFilterStrategies = $addFilterStrategies;
$this->modifiersPool = $modifiersPool ?: ObjectManager::getInstance()->get(PoolInterface::class);
$this->collection->setStoreId(Store::DEFAULT_STORE_ID);
}

/**
Expand Down Expand Up @@ -110,7 +112,7 @@ public function addField($field, $alias = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function addFilter(\Magento\Framework\Api\Filter $filter)
{
Expand Down

0 comments on commit 5da21fe

Please sign in to comment.