Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Merge requests
!10563
Move helper and delete .module
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Move helper and delete .module
issue/drupal-3494128:3494128-move-helpers-in
into
11.x
Overview
0
Commits
2
Pipelines
2
Changes
3
Closed
nicxvan
requested to merge
issue/drupal-3494128:3494128-move-helpers-in
into
11.x
4 months ago
Overview
0
Commits
2
Pipelines
2
Changes
3
Expand
Closes
#3494128
0
0
Merge request reports
Compare
11.x
version 1
f9b22fcd
4 months ago
11.x (base)
and
latest version
latest version
6453419e
2 commits,
4 months ago
version 1
f9b22fcd
1 commit,
4 months ago
3 files
+
11
−
27
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
core/modules/contact/tests/modules/contact_storage_test/src/Hook/ContactStorageTestHooks.php
+
11
−
1
Options
@@ -4,6 +4,7 @@
namespace
Drupal\contact_storage_test\Hook
;
use
Drupal\contact\ContactFormInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Field\BaseFieldDefinition
;
use
Drupal\Core\Entity\EntityTypeInterface
;
@@ -54,7 +55,16 @@ public function formContactFormFormAlter(&$form, FormStateInterface $form_state)
'#description'
=>
t
(
'Enable to send an additional email with a free pony voucher to anyone who submits the form.'
),
'#default_value'
=>
$contact_form
->
getThirdPartySetting
(
'contact_storage_test'
,
'send_a_pony'
,
FALSE
),
];
$form
[
'#entity_builders'
][]
=
'contact_storage_test_contact_form_form_builder'
;
$form
[
'#entity_builders'
][]
=
[
$this
,
'contactFormBuilder'
];
}
/**
* Entity builder for the contact form edit form with third party options.
*
* @see contact_storage_test_form_contact_form_edit_form_alter()
*/
public
function
contactFormBuilder
(
$entity_type
,
ContactFormInterface
$contact_form
,
&
$form
,
FormStateInterface
$form_state
)
:
void
{
$contact_form
->
setThirdPartySetting
(
'contact_storage_test'
,
'send_a_pony'
,
$form_state
->
getValue
(
'send_a_pony'
));
}
}
Loading