HELP!! Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/mralfred.net/httpdocs/moodle/blocks/glossary_random/block_glossary_random.php on line 122

HELP!! Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/mralfred.net/httpdocs/moodle/blocks/glossary_random/block_glossary_random.php on line 122

by mike alfred -
Number of replies: 3

Am new to the glossary am running 1.5 and everytime that
I attempt to use the glossary when I go to configure that block I get the following message at the top of the page. Does anyone know how I can fix this error report?

Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/mralfred.net/httpdocs/moodle/blocks/glossary_random/block_glossary_random.php on line 122

Average of ratings: -
In reply to mike alfred

Re: HELP!! Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/mralfred.net/httpdocs/moodle/blocks/glossary_random/block_glossary_random.php on line 122

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Mike,

Sorry I can't help you on this, but I'm sure someone will.

However, I'd like to point to two "good practice" rules for forums in general, and the Moodle forums in particular:

a) the title (Subject) of a post should be informative but not too long; in this case you might have worded your Subject title something like: "Problem with random glossary block", and you should not have included the loooooooooong message itself in your Subject title;

b) any character formating should be used sparingly if you want it to have any value at all (e.g. avoid putting everything in bold)

All the best,

Joseph

In reply to Joseph Rézeau

Re: HELP!! problem with random glossary block

by Jan Dierckx -

Mike,

The random glossary block displays a random entry from a glossary in your course. I think the warning you mention is displayed when the glossary you selected for displaying is empty. Try adding some entries to the glossary and reload the page with the block. See if that makes the warning go away.

This bug was fixed in the latest stable release of Moodle. Normally upgrading to the latest stable would also get rid of the warning.

HTH

In reply to Joseph Rézeau

Re: HELP!! Warning: Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/mralfred.net/httpdocs/moodle/blocks/glossary_random/block_glossary_random.php on line 122

by mike alfred -
Thank you for the insight. I am new to moodle and this type of thing is very helpful to me thank you.