X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fjobs.inc.php;h=723370bef2415d963be4374077fddbb5ccb8b70e;hb=dd9b361324a289efb9b4c9d67c5324a3d5036d53;hp=eb7696b89d61aab37c4716cf5616dcdccc489b7b;hpb=781a24bce24b7060f11e583565ad615ed0c497a3;p=platal.git diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index eb7696b..723370b 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -284,8 +284,9 @@ class ProfileSettingJob implements ProfileSetting } } if (count($terms_values) > 0) { - XDB::execute('REPLACE INTO profile_job_term (pid, jid, jtid, computed) - VALUES '.implode(', ', $terms_values)); + XDB::rawExecute('INSERT INTO profile_job_term (pid, jid, jtid, computed) + VALUES ' . implode(', ', $terms_values) . ' + ON DUPLICATE KEY UPDATE computed = VALUES(computed)'); } } @@ -323,8 +324,10 @@ class ProfileSettingCorps implements ProfileSetting public function save(ProfilePage &$page, $field, $value) { - XDB::execute('REPLACE INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid) - VALUES ({?}, {?}, {?}, {?}, {?})', + XDB::execute('INSERT INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid) + VALUES ({?}, {?}, {?}, {?}, {?}) + ON DUPLICATE KEY UPDATE original_corpsid = VALUES(original_corpsid), current_corpsid = VALUES(current_corpsid), + rankid = VALUES(rankid), corps_pub = VALUES(corps_pub)', $value['original'], $value['current'], $value['rank'], $value['pub'], $page->pid()); }