From d2087b994a824bc86750389557b70be25eefb327 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Sat, 9 Nov 2013 19:38:38 +0100 Subject: [PATCH] Fixed customer edit routes --- .../Controller/Admin/CustomerController.php | 22 ++++++++++--------- templates/admin/default/customer-edit.html | 1 - templates/admin/default/orders.html | 4 ++-- templates/admin/default/search.html | 8 +++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php index f312167c5..a3239542c 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerController.php @@ -107,18 +107,20 @@ class CustomerController extends AbstractCrudController 'lastname' => $object->getLastname(), 'email' => $object->getEmail(), 'title' => $object->getTitleId(), - - 'company' => $address->getCompany(), - 'address1' => $address->getAddress1(), - 'address2' => $address->getAddress2(), - 'address3' => $address->getAddress3(), - 'phone' => $address->getPhone(), - 'cellphone' => $address->getCellphone(), - 'zipcode' => $address->getZipcode(), - 'city' => $address->getCity(), - 'country' => $address->getCountryId(), ); + if ($address !== null) { + $data['company'] = $address->getCompany(); + $data['address1'] = $address->getAddress1(); + $data['address2'] = $address->getAddress2(); + $data['address3'] = $address->getAddress3(); + $data['phone'] = $address->getPhone(); + $data['cellphone'] = $address->getCellphone(); + $data['zipcode'] = $address->getZipcode(); + $data['city'] = $address->getCity(); + $data['country'] = $address->getCountryId(); + } + // A loop is used in the template return new CustomerUpdateForm($this->getRequest(), 'form', $data); } diff --git a/templates/admin/default/customer-edit.html b/templates/admin/default/customer-edit.html index 97f94deb2..24087a756 100644 --- a/templates/admin/default/customer-edit.html +++ b/templates/admin/default/customer-edit.html @@ -9,7 +9,6 @@
- {loop name="customer_edit" type="customer" current="false" id="$customer_id" backend_context="1" lang="$edit_language_id"}
diff --git a/templates/admin/default/search.html b/templates/admin/default/search.html index a39eda982..d96558ea9 100644 --- a/templates/admin/default/search.html +++ b/templates/admin/default/search.html @@ -9,7 +9,7 @@
- +