Actually takes into account modification on corps when the profile previously had...
authorStéphane Jacob <sj@m4x.org>
Mon, 7 Jun 2010 14:12:50 +0000 (16:12 +0200)
committerStéphane Jacob <sj@m4x.org>
Mon, 7 Jun 2010 14:12:50 +0000 (16:12 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/profile/jobs.inc.php

index 14f1051..61d80bb 100644 (file)
@@ -463,10 +463,8 @@ class ProfileSettingJobs extends ProfilePage
         }
 
         if ($this->changed['corps']) {
-            XDB::execute("UPDATE  profile_corps
-                             SET  original_corpsid = {?}, current_corpsid = {?},
-                                  rankid = {?}, corps_pub = {?}
-                           WHERE  pid = {?}",
+            XDB::execute('REPLACE INTO  profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid)
+                                VALUES  ({?}, {?}, {?}, {?}, {?})',
                           $this->values['corps']['original'], $this->values['corps']['current'],
                           $this->values['corps']['rank'], $this->values['corps']['pub'], $this->pid());
         }