X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fjobs.inc.php;h=760ab35250adf25be18d1a1bc455dfb36e54097f;hb=00ba8a742be0cfc70eef7c6aaaccebe7134ec087;hp=eb7696b89d61aab37c4716cf5616dcdccc489b7b;hpb=abd508e0a9df441fa1dac740013c8e2ab09d54cc;p=platal.git diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index eb7696b..760ab35 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()); }