Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Let's do the same thing we did for products: #3002474: Make the product-variation relationship more robust
When saving a product we ensure that all referenced variations have the product_id set. However, we don't do the opposite, when saving a variation we don't check that the specified product references the variation. There's no cost to doing so, cause we skip the save if there's nothing to do. We already do this two-way check on promotions and coupons.
This will allow us to create an order item and have it automatically be referenced by an order.
Comment | File | Size | Author |
---|---|---|---|
#2 | commerce_order-3005070-2.patch | 3.34 KB | jsacksick |
|
Comments
Comment #2
jsacksick CreditAttribution: jsacksick at Centarro commentedComment #4
bojanz CreditAttribution: bojanz at Centarro commentedThanks!
Comment #6
mglamanAfter testing, this effectively killed the
$save_cart
flags in CartManager and causes double saves, and the Order object in CartManager is now stale. See #2656818-23: Implement optimistic locking for ordersComment #7
bojanz CreditAttribution: bojanz at Centarro commentedThis issue was meant as a "nice to have", but introduced regressions and complicated the already complicated flow of order&order item saving. I have now reverted it.
Commit: https://cgit.drupalcode.org/commerce/commit/?id=c8fa08b
Comment #8
bojanz CreditAttribution: bojanz at Centarro commented