Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f70bf712
Commit
f70bf712
authored
Jul 27, 2015
by
alexpott
Browse files
Issue
#2536906
by aspilicious: Warning when saving third party settings while no settings available
parent
49dc0872
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/field_ui/src/Form/EntityDisplayFormBase.php
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
);
}
...
...
core/modules/field_ui/src/Tests/ManageDisplayTest.php
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'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment