From 85bb7594eeb24532c4b52dbe0da52adba112d9c8 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 5 Jul 2013 15:59:41 +0200 Subject: [PATCH] change compatibility for propel2 --- core/lib/Thelia/Action/Customer.php | 1 - core/lib/Thelia/Form/CustomerCreation.php | 3 ++- core/lib/Thelia/Model/Customer.php | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/lib/Thelia/Action/Customer.php b/core/lib/Thelia/Action/Customer.php index 98341ee28..9241fd89f 100755 --- a/core/lib/Thelia/Action/Customer.php +++ b/core/lib/Thelia/Action/Customer.php @@ -55,7 +55,6 @@ 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 b151fc98d..659bc4fe4 100644 --- a/core/lib/Thelia/Form/CustomerCreation.php +++ b/core/lib/Thelia/Form/CustomerCreation.php @@ -156,7 +156,8 @@ class CustomerCreation extends BaseForm public function verifyExistingEmail($value, ExecutionContextInterface $context) { - if (CustomerQuery::create()->filterByEmail($value)->exists()) { + $customer = CustomerQuery::create()->findOneByEmail($value); + if ($customer) { $context->addViolation("This email already exists"); } } diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php index 812a134ea..8b894140c 100644 --- a/core/lib/Thelia/Model/Customer.php +++ b/core/lib/Thelia/Model/Customer.php @@ -8,6 +8,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Thelia\Core\Event\CustomRefEvent; use Thelia\Core\Event\TheliaEvents; +use Propel\Runtime\Connection\ConnectionInterface; class Customer extends BaseCustomer { /** @@ -61,7 +62,7 @@ class Customer extends BaseCustomer { } - public function preInsert(\PropelPDO $con = null) + public function preInsert(ConnectionInterface $con = null) { $customerRef = new CustomRefEvent($this); if (!is_null($this->dispatcher)) {