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
1bcd323e
Commit
1bcd323e
authored
7 months ago
by
Klaas Eikelboom
Browse files
Options
Downloads
Patches
Plain Diff
Fix for
#3449578
: Default values overwrite updated values.
parent
7a577528
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!24
Fix for #3449578: Default values overwrite updated values.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/WebformSubmissionHandler.php
+7
-2
7 additions, 2 deletions
src/WebformSubmissionHandler.php
with
7 additions
and
2 deletions
src/WebformSubmissionHandler.php
+
7
−
2
View file @
1bcd323e
...
...
@@ -115,7 +115,12 @@ class WebformSubmissionHandler {
* This method performs alterations on the form array.
*/
public
function
alterForm
(
array
&
$form
,
FormStateInterface
$form_state
,
WebformSubmissionInterface
$webform_submission
)
{
if
(
!
$form_state
->
isSubmitted
())
{
if
(
empty
(
$form_state
->
getUserInput
()))
{
// If a form has no user input it is rendered for the first time
// then possible default values are retrieved from civicrm to
// change this form from an insert to an update form.
// Does the form have user import (because it is validating for example)
// no default values must be retrieved because they would overwrite the user input
$values
=
$this
->
formProcessorDefaultsDefault
();
if
(
!
empty
(
$values
)
&&
empty
(
$values
[
'is_error'
]))
{
unset
(
$values
[
'is_error'
]);
...
...
@@ -711,7 +716,7 @@ class WebformSubmissionHandler {
* Filter the triggers. The triggers are defined by the key and a value
* whether those are checked (1) or not checked (0).
* This function returns the keys fo the array when the value is 1
*
*
* @param $trigger
*
* @return array
...
...
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