Skip to content
Snippets Groups Projects
Commit 9d37b77b authored by Stefan Borchert's avatar Stefan Borchert
Browse files

Bug #1005270 by nicholasThompson: rules triggerd on every submit.

parent 0d0e7627
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,13 @@ function webform_rules_form_alter(&$form, $form_state, $form_id) {
* Custom submit handler for webform submissions.
*/
function webform_rules_client_form_submit($form, &$form_state) {
// If the webform is NOT completed, don't run the submit handler!
// This is relevant for multistep forms.
if (!$form_state['webform_completed']) {
return;
}
// If we've got to this point, then we are not mid-way through a form submission.
$values = $form_state['values'];
// Check if user is submitting as a draft.
$is_draft = $values['op'] == t('Save Draft');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment