warning: Invalid argument supplied for foreach() in includes/form.inc on line 1207.
No idea how to obtain a stack trace.
I see the same after upgrading to the latest dev release when editing or adding a preset.
The code that's throwing the error in form.inc is:
function form_type_checkboxes_value($form, $edit = FALSE) { if ($edit === FALSE) { $value = array(); $form += array('#default_value' => array()); foreach ($form['#default_value'] as $key) { $value[$key] = 1; } return $value; } elseif (!isset($edit)) { return array(); } }
I've not got a proper debugger set up on my new machine, but if there's no follow up on this issue I guess that will be motivation for me!
OK - it's the options_form for the tooltip and popups - defaults are NULL.
I tried removing the #default_value if it's not set (instead of setting it to NULL). This removed the errors, but caused other errors upon saving.
includes/behaviors/openlayers_behavior_popup.inc
/** * Form defintion for per map customizations. */ function options_form($defaults) { // Only prompt for vector layers $vector_layers = array(); foreach ($this->map['layers'] as $id => $name) { $layer = openlayers_layer_load($id); if (isset($layer->data['vector']) && $layer->data['vector'] == TRUE) { $vector_layers[$id] = $name; } } $options = array(); $options = array( 'layers' => array( '#title' => t('Layers'), '#type' => 'checkboxes', '#options' => $vector_layers, '#description' => t('Select layer to apply popups to.') ), ); if (isset($defaults['layers'])) { $options['#default_value'] = $defaults['layers']; } return $options; }
FYI... I am getting this as well.
Fixed in http://drupal.org/cvs?commit=387980 (note forgot # in commit message)
confirmed
Automatically closed -- issue fixed for 2 weeks with no activity.
Comments
Comment #1
tom_o_t commentedI see the same after upgrading to the latest dev release when editing or adding a preset.
The code that's throwing the error in form.inc is:
I've not got a proper debugger set up on my new machine, but if there's no follow up on this issue I guess that will be motivation for me!
Comment #2
tom_o_t commentedOK - it's the options_form for the tooltip and popups - defaults are NULL.
I tried removing the #default_value if it's not set (instead of setting it to NULL). This removed the errors, but caused other errors upon saving.
includes/behaviors/openlayers_behavior_popup.inc
Comment #3
gmclelland commentedFYI... I am getting this as well.
Comment #4
zzolo commentedFixed in http://drupal.org/cvs?commit=387980 (note forgot # in commit message)
Comment #5
strk commentedconfirmed