Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP order edit returns empty address model instead of null #1401

Closed
jmauzyk opened this issue Apr 21, 2020 · 1 comment
Closed

CP order edit returns empty address model instead of null #1401

jmauzyk opened this issue Apr 21, 2020 · 1 comment

Comments

@jmauzyk
Copy link

jmauzyk commented Apr 21, 2020

Description

From a front end request, if cart addresses are not set they return null. However, when addresses are not set and a line item is added to the cart from the CP order edit page, it appears to be returning an address model with all empty or null attributes. As a result, when the order recalculates any adjusters that do a boolean or null check against shippingAddress return true but then throw errors when trying to access attributes from the empty address model. For consistency, is it possible to return null for shippingAddress and billingAddress from the CP order edit page when addresses are not set?

Additional info

  • Craft version: 3.4.15
  • PHP version: 7.2.24
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions: Commerce 3.1.2
@nfourtythree
Copy link
Contributor

Hi @jmauzyk

Thank you for bringing this to our attention.

A fixed has been pushed and will be included in the next release.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants