Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_lock_multi_values
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
field_lock_multi_values
Commits
a4217e4d
Commit
a4217e4d
authored
5 months ago
by
Kurucz István
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3496272
by nevergone: Refactor deprecated code
parent
90dc0ccc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
field_lock_multi_values.module
+7
-6
7 additions, 6 deletions
field_lock_multi_values.module
with
7 additions
and
6 deletions
field_lock_multi_values.module
+
7
−
6
View file @
a4217e4d
<?php
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Render\Element
;
/**
* Implements hook_field_widget_third_party_settings_form().
*/
function
field_lock_multi_values_field_widget_third_party_settings_form
(
\Drupal\Core\Field\WidgetInterface
$plugin
,
\Drupal\Core\Field\FieldDefinitionInterface
$field_definition
,
string
$form_mode
,
array
$form
,
\Drupal\Core\Form\
FormStateInterface
$form_state
)
:
array
{
function
field_lock_multi_values_field_widget_third_party_settings_form
(
\Drupal\Core\Field\WidgetInterface
$plugin
,
\Drupal\Core\Field\FieldDefinitionInterface
$field_definition
,
string
$form_mode
,
array
$form
,
FormStateInterface
$form_state
)
:
array
{
$element
=
[];
$field_storage
=
$field_definition
->
getFieldStorageDefinition
();
$plugin_definition
=
$plugin
->
getPluginDefinition
();
...
...
@@ -68,17 +69,17 @@ function field_lock_multi_values_field_widget_settings_summary_alter(array &$sum
}
/**
* Implements hook_field_widget_
multivalu
e_form_alter().
* Implements hook_field_widget_
complet
e_form_alter().
*/
function
field_lock_multi_values_field_widget_
multivalu
e_form_alter
(
array
&
$
elements
,
\Drupal\Core\F
orm
\
FormStateInterface
$form_state
,
array
$context
)
:
void
{
function
field_lock_multi_values_field_widget_
complet
e_form_alter
(
array
&
$
field_widget_complete_f
orm
,
FormStateInterface
$form_state
,
array
$context
)
:
void
{
$settings
=
$context
[
'widget'
]
->
getThirdPartySetting
(
'field_lock_multi_values'
,
'settings'
);
$
elements
[
'#field_lock_multi_values'
]
=
$settings
;
$
field_widget_complete_form
[
'widget'
]
[
'#field_lock_multi_values'
]
=
$settings
;
}
/**
* Implements hook_field_widget_form_alter().
* Implements hook_field_widget_
single_element_
form_alter().
*/
function
field_lock_multi_values_field_widget_form_alter
(
array
&
$element
,
\Drupal\Core\Form\
FormStateInterface
$form_state
,
array
$context
)
:
void
{
function
field_lock_multi_values_field_widget_
single_element_
form_alter
(
array
&
$element
,
FormStateInterface
$form_state
,
array
$context
)
:
void
{
$settings
=
$context
[
'widget'
]
->
getThirdPartySetting
(
'field_lock_multi_values'
,
'settings'
);
if
(
$settings
!==
NULL
)
{
$element_children
=
Element
::
children
(
$element
);
...
...
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