Order item not being linked to order

Created on 12 March 2020, almost 5 years ago
Updated 19 September 2024, 3 months ago

Having run the commerce migrations I can see orders with address and pricing adjustments for shipping, but no order items.

Looking in the database "commerce_order_item" is populated with all the items, but the order_id column is NULL. The "commerce_order__order_items" table is empty.

For every imported order line item, during the migration using drush, I see the following warning:
Invalid argument supplied for foreach() OrderItemDiscountAdjustment.php:138

πŸ› Bug report
Status

RTBC

Version

3.2

Component

Drupal Commerce 1.x

Created by

πŸ‡¬πŸ‡§United Kingdom iancawthorne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States aasarava
  • πŸ‡ΊπŸ‡ΈUnited States rclemings

    For one order, and only one, I just found a situation similar to #15 -- an entry in field_data_commerce_line_items but no matching entry in field_revision_commerce_line_items. Moreover, the same was true for the following tables as well:

    field_data_commerce_total/field_revision_commerce_total
    field_data_commerce_order_total/field_revision_commerce_order_total
    field_data_commerce_customer_billing/field_revision_commerce_customer_billing

    The same fix worked in each case -- export the record from field_data and import it into field_revision. Took quite a while to figure that out though.

    The only error I saw at any point was "upgrade_commerce1_order:total_price: CommercePrice input array is invalid for destination 'total_price'." Better than nothing but not really that informative.

  • πŸ‡ΊπŸ‡ΈUnited States spacetaxi

    Patch #43 works for me, Thanks!

Production build 0.71.5 2024