As an admin user, when visiting the webform node type creation or edit forms with this module enabled, array_key_sxists() is throwing an error if there are no nid's in the variable_get() return.

To fix, I rearranged your hook_form_alter():

<?php
/**
 * Implements hook_form_alter().
 */
function webform_ajax_submit_form_alter(&$form, &$form_state, $form_id) {
  // Apply only to nodes from settings.
  $nodes = unserialize(variable_get('webform_ajax_submit', ''));
  if (isset($form['#node']->nid) &&
      $nodes[$form['#node']->nid] == TRUE &&
      $form_id == 'webform_client_form_' . $form['#node']->nid) {
    if (is_array($nodes) && array_key_exists($form['#node']->nid, $nodes)) {
      $form['actions']['submit']['#ajax'] = array(
        'callback' => 'webform_ajax_submit_ajax_callback',
        'wrapper' => str_replace('_', '-', $form['#form_id']),
      );
      // Custom submit handler for webform submission.
      $form['#submit'][] = 'webform_ajax_submit_ajax_form_submit_redirect';
    }
  }
  elseif ($form_id == 'webform_configure_form') {
    $form['submission']['redirection']['redirect']['#options']['none_ajax'] = t('No redirect - Use AJAX');
    // We have to insert our submit before webform's submit runs to allow handling of
    // newly added radio #option.
    // Custom submit handler for webform configuration page submission.
    array_unshift($form['#submit'], 'webform_ajax_submit_ajax_form_submit_config');
  }
}
?>

Comments

alex.skrypnyk’s picture

Fixed in 7.x-1.1

alex.skrypnyk’s picture

Assigned: Unassigned » alex.skrypnyk
Issue summary: View changes
Status: Active » Fixed
alex.skrypnyk’s picture

Status: Fixed » Closed (fixed)