If several 'new' NLs exist, default is the latest
authorArnaud Borde <arnaud.borde.2006@polytechnique.org>
Sun, 6 Dec 2009 00:04:38 +0000 (01:04 +0100)
committerArnaud Borde <arnaud.borde.2006@polytechnique.org>
Sun, 6 Dec 2009 01:05:11 +0000 (02:05 +0100)
Signed-off-by: Arnaud Borde <arnaud.borde.2006@polytechnique.org>
include/newsletter.inc.php

index e8cc260..c899e55 100644 (file)
@@ -43,7 +43,7 @@ class NewsLetter extends MassMailer
             if (!$res->numRows()) {
                 Newsletter::create();
             }
-            $res = XDB::query("SELECT * FROM newsletter WHERE bits='new'");
+            $res = XDB::query("SELECT * FROM newsletter WHERE bits='new' ORDER BY id DESC LIMIT 1");
         }
         if ($res->numRows() != 1) {
             throw new MailNotFound();