Hi
I just installed simple_karma on a drupal 5.2 system and immediately received a PHP warning on the configuration page. The warning states: warning: Invalid argument supplied for foreach() in /opt/drupal-5.2/includes/form.inc on line 948.
Line 948 contains the following:
function form_select_options($element, $choices = NULL) {
if (!isset($choices)) {
$choices = $element['#options'];
}
// array_key_exists() accommodates the rare event where $element['#value'] is NULL.
// isset() fails in this situation.
$value_valid = isset($element['#value']) || array_key_exists('#value', $element);
$value_is_array = is_array($element['#value']);
$options = '';
<b>foreach ($choices as $key => $choice) {</b> // this is line 948
if (is_array($choice)) {
...
Any idea why this happens?
The module seems to work fine.
Comments
Comment #1
mercmobily commentedHi,
The warning is there if you have no categories defined. It's a very minor bug, which will be fixed in the next version of the module!
In the meantime, don't sweat :-D
Bye,
Merc.
Comment #2
mercmobily commentedHi,
This is fixed in the version of the module on my machine right now.
I will mark it as "fixed" now - it will be online in 5/6 days.
Merc.
Comment #3
(not verified) commented