When multiple order item types and multiple order types are created, the "Inline entity form - Complex" widget allows order items of any types to be added to orders. There is a select menu to the left of the the "Add new order item" button that offers the choice of any order item type. This is incorrect behavior. Only order item types corresponding to the order type should be allowed to be added to an order. There's a UI bug where the order item type is being ignored by the widget (and possibly by the underlying field).

Comments

lisastreeter created an issue. See original summary.

jackbravo’s picture

This issue was created in response to this drupalStackexchange question: https://drupal.stackexchange.com/questions/237694/commerce-2-x-confusion...

czigor’s picture

Status: Active » Needs review
StatusFileSize
new1.3 KB

Added a check in OrderForm.

czigor’s picture

Adding an isset() check to prevent notices in case the form is not using IEF or does not allow adding new line items.

The last submitted patch, 3: commerce-2890837-order_item_type_validation-3.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 4: commerce-2890837-order_item_type_validation-4.patch, failed testing. View results

czigor’s picture

StatusFileSize
new1.54 KB

Adding one more variable check.

czigor’s picture

Status: Needs work » Needs review
tkiehne’s picture

Re-rolling this against the latest 2.x branch.

loze’s picture

Was no longer applying, Rerolled for the latest dev

  • jsacksick committed e2d40d51 on 8.x-2.x authored by loze
    Issue #2890837 by czigor, loze: Order item type being ignored by the...
jsacksick’s picture

Status: Needs review » Fixed

Committed, thanks!

  • jsacksick committed c6ebad84 on 3.0.x authored by loze
    Issue #2890837 by czigor, loze: Order item type being ignored by the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ankondrat4’s picture

A little bit confusing update and request. Why we need to forbid adding different types of order items to the order?