Index: captcha.admin.inc =================================================================== --- captcha.admin.inc (revision 51) +++ captcha.admin.inc (working copy) @@ -142,14 +142,16 @@ */ function captcha_admin_settings_submit($form, &$form_state) { variable_set('captcha_administration_mode', $form_state['values']['captcha_administration_mode']); - foreach ($form_state['values']['captcha_types'] as $captcha_point_form_id => $data) { - if ($data['captcha_type'] == 'none') { - db_query("UPDATE {captcha_points} SET module = NULL, type = NULL WHERE form_id = '%s'", $captcha_point_form_id); + if (is_array($form_state['values']['captcha_types']) && !empty($form_state['values']['captcha_types'])) { + foreach ($form_state['values']['captcha_types'] as $captcha_point_form_id => $data) { + if ($data['captcha_type'] == 'none') { + db_query("UPDATE {captcha_points} SET module = NULL, type = NULL WHERE form_id = '%s'", $captcha_point_form_id); + } + else { + list($module, $type) = explode('/', $data['captcha_type']); + db_query("UPDATE {captcha_points} SET module = '%s', type = '%s' WHERE form_id = '%s'", $module, $type, $captcha_point_form_id); + } } - else { - list($module, $type) = explode('/', $data['captcha_type']); - db_query("UPDATE {captcha_points} SET module = '%s', type = '%s' WHERE form_id = '%s'", $module, $type, $captcha_point_form_id); - } } // description stuff if (module_exists('locale')) {