From: tjhunt Date: Tue, 21 Jul 2009 10:32:04 +0000 (+0000) Subject: flickr and youtube blocks: don't call print_error! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f1ec6a630caad659020e5ab8148f2389ef489185;p=moodle.git flickr and youtube blocks: don't call print_error! That screws up the entire page the block appears on, when this is just an error local to this block. --- diff --git a/blocks/tag_flickr/block_tag_flickr.php b/blocks/tag_flickr/block_tag_flickr.php index 99a0f5b5dc..da6d1ebe7b 100644 --- a/blocks/tag_flickr/block_tag_flickr.php +++ b/blocks/tag_flickr/block_tag_flickr.php @@ -47,7 +47,10 @@ class block_tag_flickr extends block_base { } if (empty($tagobject)) { - print_error('tagnotfound'); + $this->content = new stdClass; + $this->content->text = ''; + $this->content->footer = ''; + return $this->content; } //include related tags in the photo query ? diff --git a/blocks/tag_youtube/block_tag_youtube.php b/blocks/tag_youtube/block_tag_youtube.php index 2bbce67b6a..4303701536 100644 --- a/blocks/tag_youtube/block_tag_youtube.php +++ b/blocks/tag_youtube/block_tag_youtube.php @@ -86,7 +86,7 @@ class block_tag_youtube extends block_base { } if (empty($tagobject)) { - print_error('tagnotfound'); + return ''; } $querytag = urlencode($tagobject->name); @@ -117,7 +117,7 @@ class block_tag_youtube extends block_base { } if (empty($tagobject)) { - print_error('tagnotfound'); + return ''; } $querytag = urlencode($tagobject->name);