From 3a64d3cac7bd7a8a58badd0883c300d8234a8e53 Mon Sep 17 00:00:00 2001 From: eduard13 Date: Mon, 25 Jun 2018 21:01:30 +0300 Subject: [PATCH] Fixes updating wishlist item if an item object is passed instead its id. --- app/code/Magento/Wishlist/Model/Wishlist.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Wishlist/Model/Wishlist.php b/app/code/Magento/Wishlist/Model/Wishlist.php index 9eb4e1f5ebcd2..d6284f32c4f5e 100644 --- a/app/code/Magento/Wishlist/Model/Wishlist.php +++ b/app/code/Magento/Wishlist/Model/Wishlist.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Wishlist\Model; use Magento\Catalog\Api\ProductRepositoryInterface; @@ -637,6 +639,7 @@ public function updateItem($itemId, $buyRequest, $params = null) $item = null; if ($itemId instanceof Item) { $item = $itemId; + $itemId = $item->getId(); } else { $item = $this->getItem((int)$itemId); }