Skip to content
Snippets Groups Projects
Commit c7b1a900 authored by Jacob Rockowitz's avatar Jacob Rockowitz Committed by Jacob Rockowitz
Browse files

Issue #3311032 by jrockowitz: Webform hook may pass null webform instance, leading to error

parent 3ac20d4a
No related branches found
No related tags found
No related merge requests found
......@@ -442,12 +442,13 @@ function hook_webform_third_party_settings_form_alter(array &$form, \Drupal\Core
* @see \Drupal\webform\Plugin\WebformHandlerInterface
*/
function hook_webform_handler_invoke_alter(\Drupal\webform\Plugin\WebformHandlerInterface $handler, $method_name, array &$args) {
$webform = $handler->getWebform();
$webform_submission = $handler->getWebformSubmission();
$webform_id = $handler->getWebform()->id();
$handler_id = $handler->getHandlerId();
$state = $webform_submission->getState();
$webform = $handler->getWebform();
if ($webform) {
$webform_id = $handler->getWebform()->id();
$webform_submission = $handler->getWebformSubmission();
$state = $webform_submission->getState();
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment