From dd9b361324a289efb9b4c9d67c5324a3d5036d53 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Tue, 28 Dec 2010 21:57:51 +0100 Subject: [PATCH] Fix subscription to promotion list during registration. The actual bug seems to be a synchronisation issue while querying the db from the RPC: the registration of the user does not seem to be seen by the RPC. The fix add an explicit transaction around some queries. It also fixes the name of the list... Signed-off-by: Florent Bruneau --- modules/register.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/register.php b/modules/register.php index c70a365..331f618 100644 --- a/modules/register.php +++ b/modules/register.php @@ -328,6 +328,7 @@ class RegisterModule extends PLModule // // Create the user account. // + XDB::startTransaction(); XDB::execute("UPDATE accounts SET password = {?}, state = 'active', registration_date = NOW(), email = NULL @@ -343,6 +344,7 @@ class RegisterModule extends PLModule XDB::execute("INSERT INTO aliases (uid, alias, type) VALUES ({?}, {?}, 'alias')", $uid, $emailXorg2); } + XDB::commit(); // Add the registration email address as first and only redirection. require_once 'emails.inc.php'; @@ -373,7 +375,7 @@ class RegisterModule extends PLModule VALUES ({?}, {?})', $uid, $asso_id); $mmlist = new MMList($user); - $mmlist->subscribe("promo" . S::v('promo')); + $mmlist->subscribe("promo" . $yearpromo); } break; case 'nl': -- 2.1.4