Don't select a postal address for ax_mail when delivery failed
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sun, 16 Feb 2014 18:10:43 +0000 (19:10 +0100)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sun, 16 Feb 2014 18:35:20 +0000 (19:35 +0100)
classes/address.php

index 7f26507..0b3ae04 100644 (file)
@@ -743,7 +743,8 @@ class Address
         $ax_mail = XDB::fetchOneAssoc("SELECT  pid, jobid, groupid, type, id
                                          FROM  profile_addresses
                                         WHERE  pub IN ('public', 'ax') AND FIND_IN_SET('mail', flags) AND pid = {?}
-                                     ORDER BY  NOT FIND_IN_SET('current', flags),
+                                     ORDER BY  FIND_IN_SET('deliveryIssue', flags),
+                                               NOT FIND_IN_SET('current', flags),
                                                FIND_IN_SET('secondary', flags), type = 'job'",
                                       $this->pid);