From 0d1e0c6a2c945ff152a9404d7e575f7a440ef71b Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 3 Jul 2013 15:05:08 +0200 Subject: [PATCH] fiw typo in schema model --- core/lib/Thelia/Action/Customer.php | 1 + core/lib/Thelia/Form/CustomerCreation.php | 2 ++ core/lib/Thelia/Model/Customer.php | 1 + install/thelia.sql | 4 ++-- local/config/schema.xml | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/lib/Thelia/Action/Customer.php b/core/lib/Thelia/Action/Customer.php index e3481bdce..94d27793a 100755 --- a/core/lib/Thelia/Action/Customer.php +++ b/core/lib/Thelia/Action/Customer.php @@ -55,6 +55,7 @@ class Customer implements EventSubscriberInterface $data = $form->getData(); $customer = new CustomerModel(); try { + \Thelia\Log\Tlog::getInstance()->debug($data); $customer->createOrUpdate( $data["title"], $data["firstname"], diff --git a/core/lib/Thelia/Form/CustomerCreation.php b/core/lib/Thelia/Form/CustomerCreation.php index e2816edc0..b151fc98d 100644 --- a/core/lib/Thelia/Form/CustomerCreation.php +++ b/core/lib/Thelia/Form/CustomerCreation.php @@ -117,12 +117,14 @@ class CustomerCreation extends BaseForm )) ->add("password", "password", array( "constraints" => array( + new Constraints\NotBlank(), new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))) ), "label" => "password" )) ->add("password_confirm", "password", array( "constraints" => array( + new Constraints\NotBlank(), new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))), new Constraints\Callback(array("methods" => array( array($this, "verifyPasswordField") diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php index ca3cc7882..20146cd94 100755 --- a/core/lib/Thelia/Model/Customer.php +++ b/core/lib/Thelia/Model/Customer.php @@ -87,6 +87,7 @@ class Customer extends BaseCustomer public function setPassword($password) { + \Thelia\Log\Tlog::getInstance()->debug($password); if ($this->isNew() && ($password === null || trim($password) == "")) { throw new InvalidArgumentException("customer password is mandatory on creation"); } diff --git a/install/thelia.sql b/install/thelia.sql index 46a934a3b..94d933587 100755 --- a/install/thelia.sql +++ b/install/thelia.sql @@ -477,8 +477,8 @@ CREATE TABLE `customer` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `ref_UNIQUE` (`ref`), - INDEX `idx_ customer_customer_title_id` (`customer_title_id`), - CONSTRAINT `fk_ customer_customer_title_id` + INDEX `idx_customer_customer_title_id` (`customer_title_id`), + CONSTRAINT `fk_customer_customer_title_id` FOREIGN KEY (`customer_title_id`) REFERENCES `customer_title` (`id`) ON UPDATE RESTRICT diff --git a/local/config/schema.xml b/local/config/schema.xml index f9063c614..8b97f4e8c 100755 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -349,7 +349,7 @@ - +