]> git.mjollnir.org Git - moodle.git/commitdiff
flickr and youtube blocks: don't call print_error!
authortjhunt <tjhunt>
Tue, 21 Jul 2009 10:32:04 +0000 (10:32 +0000)
committertjhunt <tjhunt>
Tue, 21 Jul 2009 10:32:04 +0000 (10:32 +0000)
That screws up the entire page the block appears on, when this is just an error local to this block.

blocks/tag_flickr/block_tag_flickr.php
blocks/tag_youtube/block_tag_youtube.php

index 99a0f5b5dc1f8d893870ce894b33860f1016557f..da6d1ebe7b29fb1a50f8b60e7d09ab2baf54e83f 100644 (file)
@@ -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 ?
index 2bbce67b6ad2b2e4a96e0e8f68725e5b21869cd4..43037015363a240c741b654d79967a7984824ed4 100644 (file)
@@ -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);