- Issue created by @ChristianSanders
- Merge request !193476983: Set the correct wishlist ID on a duplicated wishlist item → (Open) created by ChristianSanders
So merging wishlists doesn't work if your auth account already has an active wishlist with items in it. This due to the fact that the $duplicate_wishlist_item variable on the WishlistManager->Merge() method doesn't change the wishlist_id of the wishlist_item. There is code that sets the $duplicated_wishlist_item to the $target_wishlist, but in the database, after this has completed, the merged in wishlist_item still references the anon wish list ID and thus isn't merged into the logged in users existing wishlist.
As an auth user, add a product to a wishlist. Then log out and become an anon.
As the anon, add a different product to a wishlist and then log in as your auth user.
Observe that the product you added to your wishlist as an anon hasn't made it over to your existing auth wishlist.
Adding this line of code $duplicate_wishlist_item->set('wishlist_id', $target->id());
to the merge function solves the issue as the wishlist item now correctly references the auth wishlist.
Will add an MR shortly
Active
Code