From 7bd3fddc70791d86f091d10ee9ce970c3b5927f6 Mon Sep 17 00:00:00 2001 From: mBertholino Date: Tue, 3 Jan 2012 16:06:58 +0000 Subject: [PATCH] [-] FO : fixed bug while updating customer personal information, the customer couldn't deselect the newsletter checkbox or the optin checkbox git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12083 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/front/IdentityController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index e278bdd5a..9df84bfdb 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -44,7 +44,6 @@ class IdentityControllerCore extends FrontController */ public function postProcess() { - if (isset($_POST['years']) && isset($_POST['months']) && isset($_POST['days'])) $this->customer->birthday = (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']); @@ -71,6 +70,10 @@ class IdentityControllerCore extends FrontController { $this->customer->id_default_group = (int)($prev_id_default_group); $this->customer->firstname = Tools::ucfirst(Tools::strtolower($this->customer->firstname)); + if (!isset($_POST['newsletter'])) + $this->customer->newsletter = 0; + if (!isset($_POST['optin'])) + $this->customer->optin = 0; if (Tools::getValue('passwd')) $this->context->cookie->passwd = $this->customer->passwd; if ($this->customer->update())