Permalink
Browse files

now displays a link to the full error text if there is a problem load…

…ing a feed (and debug is on) rather than display the full text inline
  • Loading branch information...
dhawes
dhawes committed Jan 19, 2005
1 parent 7530140 commit 53034e080a59febe23d273032b0f7dcc80a521e6
Showing with 10 additions and 2 deletions.
  1. +10 −2 blocks/rss_client/block_rss_client.php
@@ -104,13 +104,21 @@ function instance_allow_config() {
return true;
}
+ /**
+ *
+ */
function get_rss_by_id($rssid, $display_description, $shownumentries) {
+ global $CFG;
$returnstring = '';
$rss_record = get_record('block_rss_client', 'id', $rssid);
if (isset($rss_record) && isset($rss_record->id)) {
$rss = rss_get_feed($rss_record->id, $rss_record->url, $rss_record->type);
- if (empty($rss)) {
- // There was a failure in loading the rss feed
+
+ if ($CFG->debug && (empty($rss) || !empty($rss->ERROR))) {
+ // There was a failure in loading the rss feed, print link to full error text
+ if (!empty($rss) && !empty($rss->ERROR)) {
+ print '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_error.php?error='. urlencode($rss->ERROR) .'">Error loading a feed.</a><br />';
+ }
return;
}

0 comments on commit 53034e0

Please sign in to comment.