0

I have created a custom Webform handler which submits the Webform data to an external webservice via SOAP. All is working but now I need to submit (to the same external web service) all the older Webform submissions that were received before I enabled my custom handler.

My current custom handler has my custom SOAP code wrapped in the function

public function preSave(WebformSubmissionInterface $webform_submission)

(I'm using the preSave function as the Webform is a multipage form.)

I was just wondering what function I should use to run the same SOAP code on existing submissions?

As I know the range of submission ID's that are affected, is there code that can loop through the submissions and trigger the code based on the Submission ID?

Or alternatively, as there only about 20 of the older submissions, I could open and save each one to trigger a Handler based on submission update - in which case, what is the function call I need to wrap my SOAP code in the custom handler?

Thanks

F

2
  • Any specific reason you aren't using Remote Post Handler /admin/structure/webform/manage/WEBFORM_TYPE/handlers ? (or a custom WebformHandler class based on it) Handlers can be manually retriggered via Webforms UI.
    – Hudri
    Jan 2, 2020 at 17:18
  • Thanks - I am already using a custom Webform Handler, but I hadn't noticed the Resend option in Webform. But it looks like it only offers to Resend emails. It doesn't give you the option to resend via handlers that are not emails (my handler is not an email - is sending the submission via a SOAP web service). Do you know if that is possible? Jan 6, 2020 at 13:12

1 Answer 1

0

Just install devel php run your code and then uninstall it. https://www.drupal.org/project/devel_php As it is great for quick adhock tasks.

but yep keep back up of your database ect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.