From 7627970862e03a9061ddced3423689e9dccd6f45 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 12 Sep 2013 22:41:09 +0200 Subject: [PATCH] Corrected bug with the default "No Category" The SQL optimisation patch had introduced a bug with "No Category", now solved --- app/controllers/feedController.php | 1 + app/models/Category.php | 2 +- app/models/Feed.php | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 18a46f322..d685857bd 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -17,6 +17,7 @@ class feedController extends ActionController { if (Request::isPost ()) { $url = Request::param ('url_rss'); $cat = Request::param ('category'); + if (empty($cat)) $cat = '000000'; $user = Request::param ('username'); $pass = Request::param ('password'); $params = array (); diff --git a/app/models/Category.php b/app/models/Category.php index 362bce621..70cc0d16f 100755 --- a/app/models/Category.php +++ b/app/models/Category.php @@ -179,7 +179,7 @@ class CategoryDAO extends Model_pdo { if ($prePopulateFeeds) { $sql = 'SELECT c.id as c_id, c.name as c_name, c.color as c_color, count(e.id) as nbNotRead, f.* ' . 'FROM ' . $this->prefix . 'category c ' - . 'INNER JOIN ' . $this->prefix . 'feed f ON f.category = c.id ' + . 'LEFT OUTER JOIN ' . $this->prefix . 'feed f ON f.category = c.id ' . 'LEFT OUTER JOIN ' . $this->prefix . 'entry e ON e.id_feed = f.id AND e.is_read = 0 ' . 'GROUP BY f.id ' . 'ORDER BY c.name, f.name'; diff --git a/app/models/Feed.php b/app/models/Feed.php index e9e21f06a..2a93be757 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -502,6 +502,9 @@ class HelperFeed { } foreach ($listDAO as $key => $dao) { + if (empty ($dao['url'])) { + continue; + } if (isset ($dao['id'])) { $key = $dao['id']; }