I was able to cause

PHP Fatal error: Call to a member function getEmail() on a non-object in modules/contrib/commerce/modules/order/src/Form/CustomerFormTrait.php on line 130, referer: http://example.com/admin/commerce/orders/add

when creating a new order while having "Existing customer" radio selected but no user selected.

Steps:

  • Navigate to Orders
  • Press "+ Create new order" button
  • Select store (if many)
  • Select "Existing customer"
  • Press "Create"
  • Result: PHP Fatal error

Comments

iMiksu created an issue. See original summary.

tom_ek’s picture

Assigned: Unassigned » tom_ek
Issue tags: +DevDaysMilan

I`ll check that.

tom_ek’s picture

Hi. I have made the whole field required when Existing user is chosen. Attached is a patch.

tom_ek’s picture

Status: Active » Needs review
tom_ek’s picture

Here`s a pull request:
https://github.com/drupalcommerce/commerce/pull/421

do we need a test for this?

  • bojanz committed 6512dc2 on 8.x-2.x authored by tom_ek
    Issue #2754295 - made Search field required when Existing user selected...
bojanz’s picture

Status: Needs review » Fixed
Issue tags: -DevDaysMilan

Decided to proceed without a test. Committed, thanks!

bojanz’s picture

Issue tags: +DevDaysMilan

Restoring the tag.

Status: Fixed » Closed (fixed)

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