Skip to content
Snippets Groups Projects
Commit 4732b35e authored by Klaas Eikelboom's avatar Klaas Eikelboom
Browse files

Fix for #3345074, restore relay of parameters

parent f724aaba
No related branches found
No related tags found
1 merge request!5Fix for #3345074, restore relay of parameters
......@@ -349,13 +349,18 @@ class FormProcessorWebformHandler extends WebformHandlerBase {
}
}
/**
* {@inheritdoc}
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* @param $update
* @param $extraParams array used for example to add the results of a payment provider.
*
* @return void
*/
public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE, $params = []) {
public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE, $extraParams = []) {
$state = $webform_submission->getWebform()->getSetting('results_disabled') ? WebformSubmissionInterface::STATE_COMPLETED : $webform_submission->getState();
if ($this->configuration['states'] && in_array($state, $this->configuration['states'])) {
$this->sendToCiviCRM($webform_submission);
$this->sendToCiviCRM($webform_submission ,$extraParams);
}
}
......@@ -368,10 +373,14 @@ class FormProcessorWebformHandler extends WebformHandlerBase {
}
}
/**
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* @param $extraParams array used for example to add the results of a payment provider.
*
* @return void
*/
private function sendToCiviCRM(WebformSubmissionInterface $webform_submission) {
private function sendToCiviCRM(WebformSubmissionInterface $webform_submission, $extraParams = []) {
$data = $webform_submission->getData();
$fields = $this->formProcessorFields($this->configuration['connection'], $this->configuration['form_processor']);
foreach ($fields as $key => $field) {
......@@ -398,6 +407,7 @@ class FormProcessorWebformHandler extends WebformHandlerBase {
if ($this->configuration['form_processor_current_contact']) {
$params[$this->configuration['form_processor_current_contact']] = $this->getContactId();
}
$params = array_merge($params,$extraParams);
$call = $this->core->createCall(
$this->configuration['connection'],
'FormProcessor',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment