Fix pending NL issue retrieval
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 7 Feb 2011 07:24:40 +0000 (08:24 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 7 Feb 2011 07:24:40 +0000 (08:24 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
include/newsletter.inc.php

index 97f57eb..da97493 100644 (file)
@@ -240,8 +240,8 @@ class NewsLetter
                              FROM  newsletter_issues
                             WHERE  nlid = {?} AND state = \'new\'',
                             $this->id);
-        if ($res->numRows()) {
-            $id = $res->fetchOneCell();
+        $id = $res->fetchOneCell();
+        if ($id != null) {
             return new NLIssue($id, $this);
         } else if ($create) {
             $id = $this->createPending();