Skip to content

Commit d5892b1

Browse files
author
Stanislav Idolov
authored
ENGCOM-2130: [Forwardport] Fixes updating wishlist item if an item object is passed instead its id. #16391
2 parents 342f5cd + 5914661 commit d5892b1

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;
@@ -637,6 +639,7 @@ public function updateItem($itemId, $buyRequest, $params = null)
637639
$item = null;
638640
if ($itemId instanceof Item) {
639641
$item = $itemId;
642+
$itemId = $item->getId();
640643
} else {
641644
$item = $this->getItem((int)$itemId);
642645
}

0 commit comments

Comments
 (0)