From: Florent Bruneau Date: Tue, 28 Dec 2010 20:57:51 +0000 (+0100) Subject: Fix subscription to promotion list during registration. X-Git-Tag: xorg/1.0.2~32^2~7 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=dd9b361324a289efb9b4c9d67c5324a3d5036d53;p=platal.git 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 --- 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':