Looking at the script (http://api.joomla.org/__filesource/f...elect.php.html)
They is no logic in the code to deal with a situation where no array is being passed to the options function.
Adding the following lines to the start of the function should stop the warning message for you without any detrimental effects:
PHP Code:
if( !is_array($arr) || 0 == count($arr) ) {
return '';
}
so that it would become:
PHP Code:
function options( $arr, $key = 'value', $text = 'text', $selected = null, $translate = false )
{
if( !is_array($arr) || 0 == count($arr) ) {
return '';
}
$html = '';
foreach ($arr as $i => $option)
{
$element =& $arr[$i]; // since current doesn't return a reference, need to do this
On a secondary note, it is just a warning message and will not stop joomla working. You should really not have warnings and error messages being output on a production site, so it would probably be preferable to just surpress this output and ignore it--one would assume it will be fixed in a later release.
Bookmarks