From 55416c25db999c51e88214b23d14f7378179687c Mon Sep 17 00:00:00 2001 From: Oliver Weisenburger <90334164+oliverweisenburger@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:15:51 +0100 Subject: [PATCH] IA-1241 (#56) Co-authored-by: Sanyi --- CHANGELOG.md | 6 ++++++ Model/Api/InventoryApi.php | 11 ++--------- composer.json | 2 +- etc/module.xml | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e7d86..1230704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Release notes: ============== +2.0.12 +------- +* Fix + * Fixing error during installation on Magento Cloud + + 2.0.11 ------- * Fix diff --git a/Model/Api/InventoryApi.php b/Model/Api/InventoryApi.php index 92c7526..5155e92 100644 --- a/Model/Api/InventoryApi.php +++ b/Model/Api/InventoryApi.php @@ -12,9 +12,9 @@ use Emartech\Emarsys\Api\Data\InventoryItemInterfaceFactory; use Emartech\Emarsys\Api\Data\InventoryItemItemInterfaceFactory; use Emartech\Emarsys\Api\InventoryApiInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Model\ResourceModel\Iterator; use Magento\Inventory\Model\ResourceModel\SourceItem\Collection as SourceItemCollection; -use Magento\Inventory\Model\ResourceModel\SourceItem\CollectionFactory as SourceItemCollectionFactory; /** * Class InventoryApi @@ -23,10 +23,6 @@ */ class InventoryApi implements InventoryApiInterface { - /** - * @var SourceItemCollectionFactory - */ - private $sourceItemCollectionFactory; /** * @var SourceItemCollection @@ -61,20 +57,17 @@ class InventoryApi implements InventoryApiInterface /** * InventoryApi constructor. * - * @param SourceItemCollectionFactory $sourceItemCollectionFactory * @param InventoryApiResponseInterfaceFactory $inventoryApiResponseFactory * @param InventoryItemInterfaceFactory $inventoryItemInterfaceFactory * @param InventoryItemItemInterfaceFactory $inventoryItemItemFactory * @param Iterator $iterator */ public function __construct( - SourceItemCollectionFactory $sourceItemCollectionFactory, InventoryApiResponseInterfaceFactory $inventoryApiResponseFactory, InventoryItemInterfaceFactory $inventoryItemInterfaceFactory, InventoryItemItemInterfaceFactory $inventoryItemItemFactory, Iterator $iterator ) { - $this->sourceItemCollectionFactory = $sourceItemCollectionFactory; $this->inventoryApiResponseFactory = $inventoryApiResponseFactory; $this->inventoryItemFactory = $inventoryItemInterfaceFactory; $this->inventoryItemItemFactory = $inventoryItemItemFactory; @@ -189,7 +182,7 @@ private function handleInventoryItems(array $stockData): array */ private function initCollection(): InventoryApiInterface { - $this->sourceItemCollection = $this->sourceItemCollectionFactory->create(); + $this->sourceItemCollection = ObjectManager::getInstance()->create(SourceItemCollection::class); return $this; } diff --git a/composer.json b/composer.json index b737421..53ef918 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": ">7.0.1" }, "type": "magento2-module", - "version": "2.0.11", + "version": "2.0.12", "autoload": { "files": [ "registration.php" diff --git a/etc/module.xml b/etc/module.xml index fc853be..817e505 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,7 +1,7 @@ - +