You are here

function webform_civicrm_storage in Webform CiviCRM Integration 7.2

Same name and namespace in other branches
  1. 6.2 webform_civicrm.module \webform_civicrm_storage()

Webform submission hooks don't have access to $form_state So this extra submission handler stores it.

1 call to webform_civicrm_storage()
webform_civicrm_process_submission in ./webform_civicrm_forms.inc
Webform submission handler Create/update CiviCRM contacts and related data Called by presave, insert and update webform hooks
1 string reference to 'webform_civicrm_storage'
_webform_civicrm_webform_frontend_form_alter in ./webform_civicrm_forms.inc
Alter front-end of webforms: Called by hook_form_alter() when rendering a civicrm-enabled webform Add custom prefix. Display messages. Block users who should not have access. Set webform default values.

File

./webform_civicrm.module, line 423
Webform CiviCRM Integration Module: Links webform submissions to contacts in a CiviCRM database. @author Coleman Watts

Code

function webform_civicrm_storage($form, $form_state = NULL) {
  static $storage = array();

  // During form submission, store data for later
  if (is_array($form) && !empty($form['#node']->nid) && !empty($form_state['storage']['civicrm'])) {
    $storage[$form['#node']->nid] = $form_state['storage']['civicrm'];
  }
  elseif (is_numeric($form)) {
    return webform_civicrm_aval($storage, $form, array());
  }
}