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

  • 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 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? – FrankDesign Jan 6 at 13:12
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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