Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmrf_form_processor
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
cmrf_form_processor
Commits
4732b35e
Commit
4732b35e
authored
1 year ago
by
Klaas Eikelboom
Browse files
Options
Downloads
Patches
Plain Diff
Fix for
#3345074
, restore relay of parameters
parent
f724aaba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Fix for #3345074, restore relay of parameters
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/WebformHandler/FormProcessorWebformHandler.php
+14
-4
14 additions, 4 deletions
src/Plugin/WebformHandler/FormProcessorWebformHandler.php
with
14 additions
and
4 deletions
src/Plugin/WebformHandler/FormProcessorWebformHandler.php
+
14
−
4
View file @
4732b35e
...
...
@@ -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
,
$
p
arams
=
[])
{
public
function
postSave
(
WebformSubmissionInterface
$webform_submission
,
$update
=
TRUE
,
$
extraP
arams
=
[])
{
$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'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment