Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to build a webform that submits data to a 3rd party application. If the submission to that 3rd party application fails, how can I also "cancel" the submission itself?
I've looked into adding a form #validate callback, but the problem is it doesn't work for a multi-page form, as the callback only gets to see the values from the current page, not the whole submission.
I've also looked into the form insert and presave hooks, which can look at the complete submission, but the problem with those it that they can't "cancel" the submission itself in case the hook encounters a problem.
Thanks.
Comments
Comment #1
quicksketchThe $form_state['values'] contains the current page, but $form_state['storage'] contains the entirety of the submission. You can use that in your own validation callback.
Comment #2
quicksketchComment #3
lavamind CreditAttribution: lavamind commentedOops, sorry for not responding.
For the record, I solved this problem using your suggestion : $form_state['values']
Thanks!