From 084b3c34ed5e65f9e71eaff08fe99324e9032d1c Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 14 May 2024 11:30:19 +0530 Subject: [PATCH] Fixed: The admin was unable to change the customer after any error is displayed while creating new address for the customer, also fixed the back button --- .../template/controllers/addresses/helpers/form/form.tpl | 2 +- controllers/admin/AdminAddressesController.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl b/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl index ec102910d..e46200e15 100644 --- a/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl +++ b/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl @@ -88,7 +88,7 @@
- +
{/if} {else} diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 83a646cb6..6e052f39b 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -190,10 +190,10 @@ class AdminAddressesControllerCore extends AdminController $token_customer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id); } + $this->fields_value['email'] = Tools::getValue('email'); $this->tpl_form_vars = array( - 'customer' => isset($customer) ? $customer : null, - 'tokenCustomer' => isset($token_customer) ? $token_customer : null, - 'back_url' => urldecode(Tools::getValue('back')) + 'customer' => (isset($customer) && $this->object->id) ? $customer : null, + 'tokenCustomer' => isset($token_customer) ? $token_customer : null ); // Order address fields depending on country format