- Issue created by @TomTech
- Status changed to Needs review
over 1 year ago 8:55pm 3 August 2023 - last update
over 1 year ago 779 pass, 2 fail - Status changed to Closed: duplicate
over 1 year ago 7:03am 9 August 2023 - 🇮🇱Israel jsacksick
Probably a duplicate of 🐛 Race conditions can theoretically change placed orders Active , feel free to reopen if you think this isn't a duplicate.
- 🇮🇱Israel jsacksick
Maybe the right fix is to copy what 1.x did...
// If the order is anonymous, check the session to see if the order // belongs to the current user. Otherwise just check that the order uid // matches the current user. if ($order->uid == 0 && !commerce_cart_order_session_exists($order->order_id)) { return FALSE; }
I'm guessing we could check if the customer is anonymous that the current customer can update the order.
- Status changed to Active
over 1 year ago 2:10pm 9 August 2023 - 🇮🇱Israel jsacksick
So I'm guessing a 2.x equivalent fix could look like the following:
// Skip the order refresh in case the current customer cannot update the order. if ($order->getCustomer()->isAnonymous() && !$order->access('update')) { return FALSE; }
- Status changed to Needs review
over 1 year ago 5:56pm 9 August 2023 - last update
over 1 year ago 785 pass - 🇺🇸United States TomTech
Updated patch implementing the suggestion in #3379152-5: Skip Order Refresh on draft anonymous orders on CLI → .
Tested and resolves the issue.
While this isn't as performant as just checking the CLI variable, it is more logical, and better matches the logic back in 7.x.
- 🇮🇱Israel jsacksick
Let's test this from
OrderRefreshTest::testShouldRefresh()
. - last update
over 1 year ago 786 pass - 🇺🇸United States TomTech
As requested in #7, test steps are added in
OrderRefreshTest::testShouldRefresh()
.This doesn't actually invoke the
_commerce_cart_order_access
, though, which would ensure thatOrderRefreshTest::testShouldRefresh()
returns TRUE when the cart is present in thecart_session
.CartOrderRefreshTest.php
has been added to the cart module to test those scenarios, both when the anonymous user has the cart in thecart_session
(returning TRUE) and when it does not (returning FALSE). -
jsacksick →
committed 8641e417 on 8.x-2.x authored by
TomTech →
Issue #3379152 by TomTech, jsacksick: Skip Order Refresh on draft...
-
jsacksick →
committed 8641e417 on 8.x-2.x authored by
TomTech →
-
jsacksick →
committed f8b21ed9 on 3.0.x authored by
TomTech →
Issue #3379152 by TomTech, jsacksick: Skip Order Refresh on draft...
-
jsacksick →
committed f8b21ed9 on 3.0.x authored by
TomTech →
- Status changed to Fixed
over 1 year ago 7:45am 23 August 2023 Automatically closed - issue fixed for 2 weeks with no activity.