A free, self-hostable news aggregator…
Fix issue #158 : ajout premier flux fonctionne
Marien Fressinaudadc33811c3c9
diff --git a/app/controllers/configureController.php b/app/controllers/configureController.phpindex 6396dbfeb..a31f5582e 100755--- a/app/controllers/configureController.php+++ b/app/controllers/configureController.php@@ -8,6 +8,9 @@ class configureController extends ActionController {array ('error' => array (Translate::t ('access_denied'))));}++ $catDAO = new CategoryDAO ();+ $catDAO->checkDefault ();}public function categorizeAction () {diff --git a/app/controllers/feedController.php b/app/controllers/feedController.phpindex 18a46f322..8cb4c31c2 100755--- a/app/controllers/feedController.php+++ b/app/controllers/feedController.php@@ -9,14 +9,18 @@ class feedController extends ActionController {);}- $catDAO = new CategoryDAO ();- $catDAO->checkDefault ();+ $this->catDAO = new CategoryDAO ();+ $this->catDAO->checkDefault ();}public function addAction () {if (Request::isPost ()) {$url = Request::param ('url_rss');- $cat = Request::param ('category');+ $cat = Request::param ('category', false);+ if ($cat === false) {+ $def_cat = $this->catDAO->getDefault ();+ $cat = $def_cat->id ();+ }$user = Request::param ('username');$pass = Request::param ('password');$params = array ();diff --git a/app/models/Category.php b/app/models/Category.phpindex e733b15ba..a9f036a4e 100755--- a/app/models/Category.php+++ b/app/models/Category.php@@ -175,7 +175,7 @@ class CategoryDAO extends Model_pdo {public function checkDefault () {$def_cat = $this->searchById ('000000');- if (!$def_cat) {+ if ($def_cat === false) {$cat = new Category (Translate::t ('default_category'));$cat->_id ('000000');