This patch add support for hook_webform_submission_presave / hook_webform_submission_insert.

Because of when we integrate other webform modules (webform_civicrm), we need to collect data from there hook.

We still place this patch in beta site. This patch need further review.

Comments

arski’s picture

Version: 6.x-3.6 » 6.x-3.x-dev

Hi, thanks for this. One thing I'm wondering about - should the presave/insert hooks have the capability to alter the submission object? Because if they do (and I'm assuming that's the case), then this will not happen with that patch (because the hooks get $submission passed to them, and the actual submit handler uses $form_state directly).

Haven't checked Webform code myself yet though, so maybe my assumption is wrong. Also need to check where these hooks are normally called inside Webform.

arski’s picture

Status: Needs review » Closed (works as designed)

Actually, the module already supports both hooks, as when a pane is saved, webform_client_form_submit is called, which in turn calls webform_submission_insert which then invokes the hooks.. So I guess your problem might be more specific?

Feel free to reopen if the problem persists, but I would suggest you to debug a little more, i.e. make sure that the hook is not called in webform_civicrm and/or maybe if something else is not working correctly inside the hooks implemented there.

Cheers