diff --git a/modules/cmrf_form_processor_mollie/cmrf_form_processor_mollie.module b/modules/cmrf_form_processor_mollie/cmrf_form_processor_mollie.module index 135ad12e6ef2266b22a9e88e01b8bb63c8428ffd..694c572a912ed9ffef3ad8eaf239f9f3406ff2e4 100644 --- a/modules/cmrf_form_processor_mollie/cmrf_form_processor_mollie.module +++ b/modules/cmrf_form_processor_mollie/cmrf_form_processor_mollie.module @@ -26,7 +26,8 @@ use Drupal\webform\Plugin\WebformHandlerInterface; function cmrf_form_processor_mollie_webform_handler_invoke_post_save_alter(WebformHandlerInterface $handler, array &$args) { /* makes only sense for form processors */ - if ($handler->getPluginId() != 'cmrf_form_processor') { + $plugin_definition = $handler->getPluginDefinition(); + if ($plugin_definition['provider'] != 'cmrf_form_processor') { return; } @@ -36,7 +37,8 @@ function cmrf_form_processor_mollie_webform_handler_invoke_post_save_alter(Webfo $handlers = $webform->getHandlers(); foreach ($handlers as $h) { - if ($h->getPluginId() == 'mollie_payment_handler') { + $plugin_definition = $h->getPluginDefinition(); + if ($plugin_definition['provider'] == 'mollie_webform') { $paymentHandler = $h; } } diff --git a/modules/cmrf_form_processor_mollie/src/EventSubscriber/MollieFormProcessorSubscriber.php b/modules/cmrf_form_processor_mollie/src/EventSubscriber/MollieFormProcessorSubscriber.php index a4e098806eafa214d43138b93babcdb92023d628..850077ebef6e598fa67b8ffbfba1d770c8ebe186 100644 --- a/modules/cmrf_form_processor_mollie/src/EventSubscriber/MollieFormProcessorSubscriber.php +++ b/modules/cmrf_form_processor_mollie/src/EventSubscriber/MollieFormProcessorSubscriber.php @@ -40,7 +40,10 @@ class MollieFormProcessorSubscriber implements EventSubscriberInterface { $submission = $this->entityTypeManager->getStorage('webform_submission') ->load($event->getContextId()); $webform = $submission->getWebform(); - $handlers = $webform->getHandlers('cmrf_form_processor'); + $handlers = array_filter($webform->getHandlers(), function($handler) { + $plugin_definition = $handler->getPluginDefinition(); + return $plugin_definition['provider'] === 'cmrf_form_processor'; + }); $transaction = $this->entityTypeManager->getStorage('mollie_payment') ->load($event->getTransactionId());