From: dhawes Date: Wed, 19 Jan 2005 23:59:21 +0000 (+0000) Subject: now displays a link to the full error text if there is a problem loading a feed ... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=53034e080a59febe23d273032b0f7dcc80a521e6;p=moodle.git now displays a link to the full error text if there is a problem loading a feed (and debug is on) rather than display the full text inline --- diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 7f2f084639..4a443c4d30 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -104,13 +104,21 @@ class block_rss_client extends block_base { 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 'Error loading a feed.
'; + } return; }