Fix SQL error in watch_nonins.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 12 Jan 2009 08:35:35 +0000 (09:35 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 12 Jan 2009 08:35:35 +0000 (09:35 +0100)
This is not a really fix, it only ignores the error (the entry is added
twice).

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/notifs.inc.php

index d48f010..8427bf9 100644 (file)
@@ -446,7 +446,7 @@ class NoninsNotifs
 
     public function add($p)
     {
-        XDB::execute('INSERT INTO  watch_nonins (uid,ni_id) VALUES({?},{?})', $this->_uid, $p);
+        XDB::execute('INSERT IGNORE INTO  watch_nonins (uid,ni_id) VALUES({?},{?})', $this->_uid, $p);
         $res = XDB::query('SELECT  prenom,IF(nom_usage="",nom,nom_usage) AS nom,promo,user_id
                              FROM  auth_user_md5
                             WHERE  user_id={?}', $p);