After update Drupal Commerce of the lasted version, Order Type Item result Empty.

I do a bit of debug about the view commerce_order_item_table

After loking the code at /commerce/modules/order/src/Plugin/Field/FieldFormatter/OrderItemTable.php


  public function viewElements(FieldItemListInterface $items, $langcode) {
    /** @var \Drupal\commerce_order\Entity\OrderInterface $order */
    $order = $items->getEntity();
    $elements = [];
    $order_item_ids = array_column($order->get('order_items')->getValue(), 'target_id');
    $elements[0] = [
      '#type' => 'view',
      // @todo Allow the view to be configurable.
      '#name' => 'commerce_order_item_table',
      '#arguments' => $order_item_ids ? [implode('+', $order_item_ids)] : NULL,
      '#embed' => TRUE,
    ];

    return $elements;
  }

I see that my contestual filter was set on Order_id field, but the order_item_ids variable is about the Id objects!

Resolution

I change the field of contestual filter, to point the ID with multiselect Active.

Comments

DanubioBlu created an issue. See original summary.

agoradesign’s picture

You should have read the Release notes ;)
There's a CR about that

agoradesign’s picture

Category: Bug report » Support request
Status: Active » Closed (works as designed)
cayenne’s picture

So, for those of using version 2.24 and still having the bug, is the advice to patch the code?

Aha. yes, read the release note. those of us who have fiddled with the view have to fiddle a little bit more.

https://www.drupal.org/node/3197301