bug wrt homonymes
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Sat, 4 Dec 2004 23:26:46 +0000 (23:26 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:26:29 +0000 (23:26 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-43

include/email.classes.inc.php
upgrade/0.9.3/10_aliases.sql

index 49a24ee..527cdda 100644 (file)
@@ -64,7 +64,7 @@ function fix_bestalias($uid)
     }
     $globals->db->query("UPDATE  aliases
                             SET  flags=CONCAT(flags,',','bestalias')
-                         WHERE  id='$uid'
+                         WHERE  id='$uid' AND type!='homonyme'
                       ORDER BY  !FIND_IN_SET('epouse',flags),alias LIKE '%.%', LENGTH(alias)
                          LIMIT  1");
 }
index ee78f77..a8d8471 100644 (file)
@@ -7,4 +7,4 @@ alter table aliases add index (flags);
     update  aliases AS a
 left  join  aliases AS b ON(a.id=b.id and b.alias like '%.%' and length(b.alias)<length(a.alias))
        set  a.flags=CONCAT(a.flags,',bestalias')
-     where  a.alias LIKE '%.%' and b.alias IS NULL;
+     where  a.alias LIKE '%.%' and b.alias IS NULL and a.type!='homonyme' and b.type!='homonyme';