Skip to content

Commit 6b9ad4d

Browse files
committed
ACP2E-618: caroussel problem with sorting by High stock
- fix static fail
1 parent d59d32b commit 6b9ad4d

File tree

1 file changed

+4
-3
lines changed
  • app/code/Magento/CatalogInventory/Model/Source

1 file changed

+4
-3
lines changed

app/code/Magento/CatalogInventory/Model/Source/Stock.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\CatalogInventory\Model\Stock as StockModel;
1010
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
1111
use Magento\Eav\Model\Entity\Collection\AbstractCollection;
12+
use Magento\Framework\App\ObjectManager;
1213
use Magento\Framework\Data\Collection;
1314
use Magento\Framework\EntityManager\MetadataPool;
1415

@@ -29,12 +30,12 @@ class Stock extends AbstractSource
2930
private $metadataPool;
3031

3132
/**
32-
* @param MetadataPool $metadataPool
33+
* @param MetadataPool|null $metadataPool
3334
*/
3435
public function __construct(
35-
MetadataPool $metadataPool
36+
MetadataPool $metadataPool = null
3637
) {
37-
$this->metadataPool = $metadataPool;
38+
$this->metadataPool = $metadataPool ?? ObjectManager::getInstance()->get(MetadataPool::class);
3839
}
3940

4041
/**

0 commit comments

Comments
 (0)