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

[4.x] Fixed PHP error when updating an unsaved cart with an address #3855

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading