Skip to content

Commit

Permalink
Fixes updating wishlist item if an item object is passed instead its id.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard13 committed Jun 24, 2018
1 parent e80727a commit 1127769
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/code/Magento/Wishlist/Model/Wishlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1127769

Please sign in to comment.