From: Stéphane Jacob Date: Fri, 17 Jun 2011 21:18:24 +0000 (+0200) Subject: No updates needed if no old pids. X-Git-Tag: xorg/1.1.2~13 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=24b027866273673c39da014df7d02a19997b22a1;p=platal.git No updates needed if no old pids. Signed-off-by: Stéphane Jacob --- diff --git a/modules/admin.php b/modules/admin.php index 81c0182..6a61466 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -1972,10 +1972,12 @@ class AdminModule extends PLModule $pids = array_unique($new_pids); // Updates years. - XDB::execute('UPDATE profile_education - SET entry_year = {?}, grad_year = {?}, promo_year = {?} - WHERE pid IN {?} AND eduid = {?} AND degreeid = {?}', - $entry_year, $promotion, $promotion, $old_pids, $edu_id, $degree_id); + if (count($old_pids)) { + XDB::execute('UPDATE profile_education + SET entry_year = {?}, grad_year = {?}, promo_year = {?} + WHERE pid IN {?} AND eduid = {?} AND degreeid = {?}', + $entry_year, $promotion, $promotion, $old_pids, $edu_id, $degree_id); + } } // Precomputes values common to all users.