From 12e7920fe224ea9c720eeb246b7b5e65f70544b0 Mon Sep 17 00:00:00 2001 From: Nathaniel Hammond Date: Fri, 6 Dec 2024 16:04:27 +0000 Subject: [PATCH] Fixed errors not showing on order edit after saving --- CHANGELOG.md | 4 ++++ src/controllers/OrdersController.php | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b86159db3..c2030227c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft Commerce +## Unreleased + +- Fixed a bug where order errors weren't showing on the Edit Order page. + ## 4.7.1 - 2024-12-02 - Fixed an error that occurred on the Orders index page when running Craft CMS 4.13.4 or later. ([#3793](https://github.com/craftcms/commerce/issues/3793)) diff --git a/src/controllers/OrdersController.php b/src/controllers/OrdersController.php index 0a7533352f..a35dfc37db 100644 --- a/src/controllers/OrdersController.php +++ b/src/controllers/OrdersController.php @@ -1251,6 +1251,7 @@ private function _registerJavascript(array $variables): void if ($variables['order']->hasErrors()) { $response['order']['errors'] = $variables['order']->getErrors(); + $response['errors'] = $variables['order']->getErrors(); $response['error'] = Craft::t('commerce', 'The order is not valid.'); }