Skip to content
Browse files

Fix for bug 3793:

Prevent warning message when configuring a glossary_random block in a
course which has no glossaries.
  • Loading branch information...
1 parent aef6766 commit 3b80afab6363ad34f4790b8ad357b0a1021c5a74 defacer committed Jul 23, 2005
Showing with 5 additions and 2 deletions.
  1. +5 −2 blocks/glossary_random/block_glossary_random.php
View
7 blocks/glossary_random/block_glossary_random.php
@@ -118,9 +118,12 @@ function instance_config_print() {
// select glossaries to put in dropdown box ...
$glossaries = get_records_select_menu('glossary', 'course='.$this->course->id,'name','id,name');
+
//format menu texts to avoid html and to filter multilang values
- foreach($glossaries as $key => $value) {
- $glossaries[$key] = strip_tags(format_string($value,true));
+ if(!empty($glossaries)) {
+ foreach($glossaries as $key => $value) {
+ $glossaries[$key] = strip_tags(format_string($value,true));
+ }
}
// and select quotetypes to put in dropdown box

0 comments on commit 3b80afa

Please sign in to comment.
Something went wrong with that request. Please try again.