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
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3176591-test-only.patch | 3.75 KB | eiriksm |
| #4 | 3176591.patch | 4.31 KB | eiriksm |
| #2 | 3176591.patch | 4.32 KB | eiriksm |
| #2 | 3176591-test-only.patch | 3.75 KB | eiriksm |
Comments
Comment #2
eiriksmSo, 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.
Comment #3
eiriksmComment #4
eiriksmComment #7
zaporylieCommitted and pushed to 8.x-1.x