Problem/Motivation

This basically uncovers that we have a "hidden" dependency on commerce shipping, since if you did not have shipping installed, the following error would occur:

InvalidArgumentException: Field shipments is unknown.

Instead, if you have shipping installed, but are trying to order something with no shipments, you get this error:

Notice: Trying to get property 'entity' of non-object in /mysite/drupal/modules/contrib/commerce_dibs/src/EasyOrderBuilder.php on line 46

And then even more severe:

Error: Call to a member function getShippingProfile() on null in Drupal\commerce_dibs\EasyOrderBuilder->buildOrder()

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

eiriksm created an issue. See original summary.

eiriksm’s picture

Status: Active » Needs review
StatusFileSize
new3.75 KB
new4.32 KB

So, here is a patch that fixes both problems actually, but we would not have to have all this boilerplate and additional test dependency if we just wanted to avoid that. That is just to "prove" the bug.

eiriksm’s picture

Issue summary: View changes
eiriksm’s picture

StatusFileSize
new4.31 KB
new3.75 KB

Status: Needs review » Needs work

The last submitted patch, 4: 3176591-test-only.patch, failed testing. View results

  • zaporylie committed d880e4c on 8.x-1.x authored by eiriksm
    Issue #3176591 by eiriksm: Site crashes if the order has no shipment
    
zaporylie’s picture

Status: Needs work » Fixed

Committed and pushed to 8.x-1.x

Status: Fixed » Closed (fixed)

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