summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-08-19 21:39:45 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-08-19 21:39:45 +0200
commit0d0b8cd39b8de765aa351a2e66fff850bdcb2000 (patch)
treeca3f30f4983cb1b799a175d41a36d267d950892e /app
parent50075bfbdcd6a7be010eb82ce1fffac0ea283de7 (diff)
Error when feed does not exist
https://github.com/marienfressinaud/FreshRSS/issues/579
Diffstat (limited to 'app')
-rw-r--r--app/Models/Feed.php6
-rw-r--r--app/views/helpers/view/normal_view.phtml7
2 files changed, 12 insertions, 1 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index fe1e52ea2..2a5ea45ac 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -28,6 +28,12 @@ class FreshRSS_Feed extends Minz_Model {
}
}
+ public static function example() {
+ $f = new FreshRSS_Feed('http://example.net/', false);
+ $f->faviconPrepare();
+ return $f;
+ }
+
public function id() {
return $this->id;
}
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index 55ef6bdf6..87bf2e22a 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -81,7 +81,12 @@ if (!empty($this->entries)) {
}
}
$feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache
- if (empty($feed)) $feed = $item->feed (true);
+ if ($feed == null) {
+ $feed = $item->feed(true);
+ if ($feed == null) {
+ $feed = FreshRSS_Feed::example();
+ }
+ }
?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
<li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
<?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>