fuzionnz / webform_civicrm_migrate

0 stars 6 forks source link

Disable the CiviCRM handler during submissions import and create a migrate plugin for D7WebformCivicrmSubmission #8

Open herbdool opened 1 year ago

herbdool commented 1 year ago

I just left a comment here https://www.drupal.org/project/webform_civicrm/issues/3320379#comment-14997370 and figured this module might be a good place for dealing with CiviCRM submissions without triggering the whole CiviCRM processing.

This looks like a promising hook:

hook_webform_handler_invoke_alter(\Drupal\webform\Plugin\WebformHandlerInterface $handler, $method_name, array &$args)

If the CiviCRM handler is disabled then there would need to be a submission handler specific for the webform_civicrm_submissions table, similar to D7WebformSubmission in the webform_migrate module.

jmcclelland commented 3 months ago

Hi @herbdool - I am running into the same problem. I see that you haven't had much luck getting your changes merged in the webform_civicrm module. I was wondering if you figured out a way to address this problem?

herbdool commented 3 months ago

@jmcclelland I had added my patch to the composer file for the website. But now that it's all migrated don't need the patch. Still it's a shame that they won't merge it. Maybe you can chime in on the issue.

herbdool commented 3 months ago

@jmcclelland in particular test this PR https://github.com/colemanw/webform_civicrm/pull/894

jmcclelland commented 3 months ago

@herbdool Thanks for the follow up - I'll definitely chime in. But... how did you disable the webform_civicrm handler just for submission imports? In this ticket you reference hook_webform_handler_invoke_alter(\Drupal\webform\Plugin\WebformHandlerInterface $handler, $method_name, array &$args) but I'm still trying to wrap my head around how to use that hook to disable the handler just for migrating submissions.

herbdool commented 3 months ago

I think I ended up not using that hook. I just disabled the handler manually for each webform. It can be disabled in the UI or by changing the yml file for the webform and importing config changes.

jmcclelland commented 3 months ago

Thanks so much for the feedback. I think I sorted out the hook code and submitted a PR. I'll also follow up on the webform PR.