diff --git a/core/lib/Thelia/Controller/Front/CartController.php b/core/lib/Thelia/Controller/Front/CartController.php index b143a0396..62b68a3fc 100644 --- a/core/lib/Thelia/Controller/Front/CartController.php +++ b/core/lib/Thelia/Controller/Front/CartController.php @@ -62,7 +62,7 @@ class CartController extends BaseFrontController } if ($message) { - $cartAdd->setErrorMessage($e->getMessage()); + $cartAdd->setErrorMessage($message); $this->getParserContext()->setErrorForm($cartAdd); } } diff --git a/core/lib/Thelia/Controller/Front/CustomerController.php b/core/lib/Thelia/Controller/Front/CustomerController.php index 7182fac01..86ee1afe7 100644 --- a/core/lib/Thelia/Controller/Front/CustomerController.php +++ b/core/lib/Thelia/Controller/Front/CustomerController.php @@ -33,6 +33,11 @@ use Thelia\Core\Event\TheliaEvents; class CustomerController extends BaseFrontController { + /** + * create a new Customer. Retrieve data in form and dispatch a action.createCustomer event + * + * if error occurs, message is set in the parserContext + */ public function createAction() { $request = $this->getRequest(); @@ -66,10 +71,14 @@ class CustomerController extends BaseFrontController $this->processLogin($customerCreateEvent->getCustomer()); + $this->redirectSuccess(); + } catch (FormValidationException $e) { - + $customerCreation->setErrorMessage($e->getMessage()); + $this->getParserContext()->setErrorForm($customerCreation); } catch (PropelException $e) { - + \Thelia\Log\Tlog::getInstance()->error(sprintf("error during customer creation process in front context with message : %s", $e->getMessage())); + $this->getParserContext()->setGeneralError($e->getMessage()); }