- π¬π§United Kingdom steven jones
To reproduce:
- Add an item A to your cart.
- Log in
- Log out
- Add an item A to your cart.
- Log in
This is because our call in
\Drupal\commerce_combine_carts\CartUnifier::combineCarts
to:$this->cartManager->addOrderItem($main_cart, $item, $combine);
Seems to assume that the order item will get moved over to the
$main_cart
where in fact, if there's already a duplicate and$combine
isTRUE
then it's entirely possible that the quantity will be increased on an already existing order item with a different id.So, we can look at the return value and if it's different, remove the order item from the
$other_cart
, patch inbound. - Assigned to steven jones
- Status changed to Needs review
about 1 year ago 5:21am 21 September 2023 - π¬π§United Kingdom steven jones
Here's a couple of patches, one that just has the test and another that has the fix too.
- Issue was unassigned.
- π¬π§United Kingdom steven jones
Oh, this doesn't need to be assigned to me any more.
- last update
about 1 year ago 1 fail - last update
about 1 year ago 1 pass - πΊπΈUnited States bmcclure West Virginia
That makes sense for the reproduction steps, and the approach to the fix looks sound.
I haven't had a chance to test this, so just to confirm, is the test-only patch sufficient to make the test fail without the fix? If so then this seems good to go to me.
The last submitted patch, 6: commerce_combine_carts-3195585-6-orphan-item-tests.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- πΊπΈUnited States bmcclure West Virginia
With these test results being good, I think this fix is probably ready to go!
- last update
about 1 year ago run-tests.sh fatal error - @steven-jones opened merge request.
-
Steven Jones β
committed 443ab76b on 8.x-1.x
Issue #3195585 by Steven Jones, bmcclure: Orphan line items after...
-
Steven Jones β
committed 443ab76b on 8.x-1.x
- Status changed to Fixed
about 1 year ago 7:31pm 21 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.