Skip to content

Commit f2038a9

Browse files
committed
Fixes updating wishlist item if an item object is passed instead its id.
1 parent c20946e commit f2038a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Wishlist/Model/Wishlist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Wishlist\Model;
79

810
use Magento\Catalog\Api\ProductRepositoryInterface;
@@ -611,6 +613,7 @@ public function updateItem($itemId, $buyRequest, $params = null)
611613
$item = null;
612614
if ($itemId instanceof Item) {
613615
$item = $itemId;
616+
$itemId = $item->getId();
614617
} else {
615618
$item = $this->getItem((int)$itemId);
616619
}

0 commit comments

Comments
 (0)