Skip to content

Commit

Permalink
Merge pull request #3855 from craftcms/feature/pt-2374-4x-can-not-set…
Browse files Browse the repository at this point in the history
…-a-shipping-address-on-the-order-that-is-not

[4.x] Fixed PHP error when updating an unsaved cart with an address
  • Loading branch information
nfourtythree authored Jan 22, 2025
2 parents 218810c + f06eafe commit 73085ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed a bug where Edit Product pages would allow duplication for users that didn’t have permission to duplicate the product. ([#3819](https://github.com/craftcms/commerce/issues/3819))
- Fixed a PHP error that could occur when updating a cart. ([#3842](https://github.com/craftcms/commerce/issues/3842))
- Fixed a PHP error that could occur when adding an invalid address to a cart. ([#3848](https://github.com/craftcms/commerce/issues/3848))

## 4.7.2 - 2024-12-18
Expand Down
1 change: 1 addition & 0 deletions src/controllers/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public function actionUpdateCart(): ?Response

// When we are about to update the cart, we consider it a real cart at this point, and want to actually create it in the DB.
if ($this->_cart->id === null) {
// Make sure we have a fully saved cart before attempting any mutations.
$this->_cart = $this->_getCart(true);
}

Expand Down

0 comments on commit 73085ca

Please sign in to comment.