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
Commits
f70bf712
Commit
f70bf712
authored
9 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2536906
by aspilicious: Warning when saving third party settings while no settings available
parent
49dc0872
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+1
-1
1 addition, 1 deletion
core/modules/field_ui/src/Form/EntityDisplayFormBase.php
core/modules/field_ui/src/Tests/ManageDisplayTest.php
+5
-0
5 additions, 0 deletions
core/modules/field_ui/src/Tests/ManageDisplayTest.php
with
6 additions
and
1 deletion
core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+
1
−
1
View file @
f70bf712
...
...
@@ -567,7 +567,7 @@ protected function copyFormValuesToEntity(EntityInterface $entity, array $form,
if
(
$form_state
->
get
(
'plugin_settings_update'
)
===
$field_name
)
{
// Only store settings actually used by the selected plugin.
$default_settings
=
$this
->
pluginManager
->
getDefaultSettings
(
$options
[
'type'
]);
$options
[
'settings'
]
=
array_intersect_key
(
$values
[
'settings_edit_form'
][
'settings'
],
$default_settings
);
$options
[
'settings'
]
=
isset
(
$values
[
'settings_edit_form'
][
'settings'
])
?
array_intersect_key
(
$values
[
'settings_edit_form'
][
'settings'
],
$default_settings
)
:
[]
;
$options
[
'third_party_settings'
]
=
isset
(
$values
[
'settings_edit_form'
][
'third_party_settings'
])
?
$values
[
'settings_edit_form'
][
'third_party_settings'
]
:
[];
$form_state
->
set
(
'plugin_settings_update'
,
NULL
);
}
...
...
This diff is collapsed.
Click to expand it.
core/modules/field_ui/src/Tests/ManageDisplayTest.php
+
5
−
0
View file @
f70bf712
...
...
@@ -163,6 +163,11 @@ function testFormatterUI() {
$edit
=
array
(
'fields[field_test][type]'
=>
'field_no_settings'
,
'refresh_rows'
=>
'field_test'
);
$this
->
drupalPostAjaxForm
(
NULL
,
$edit
,
array
(
'op'
=>
t
(
'Refresh'
)));
$this
->
assertFieldByName
(
'field_test_settings_edit'
);
// Make sure we can save the third party settings when there are no settings available
$this
->
drupalPostAjaxForm
(
NULL
,
array
(),
"field_test_settings_edit"
);
$this
->
drupalPostAjaxForm
(
NULL
,
$edit
,
"field_test_plugin_settings_update"
);
// Uninstall the module providing third party settings and ensure the button
// is no longer there.
\Drupal
::
service
(
'module_installer'
)
->
uninstall
(
array
(
'field_third_party_test'
));
...
...
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