Skip to content
Snippets Groups Projects
Commit 1d7474d9 authored by Dieter Holvoet's avatar Dieter Holvoet
Browse files

Issue #3460530 by dieterholvoet: Required checkbox has the wrong value when...

Issue #3460530 by dieterholvoet: Required checkbox has the wrong value when using the default (Core) Required API plugin
parent d9a051b7
No related branches found
No related tags found
1 merge request!9Load unchanged field definition
Pipeline #360244 failed
......@@ -30,6 +30,16 @@ function required_api_help($path, $arg) {
*/
function required_api_form_field_config_edit_form_alter(array &$form, FormStateInterface $form_state) {
$field_definition = $form_state->getFormObject()->getEntity();
// Load unchanged field definition because
// \Drupal\Core\Field\FieldItemList::defaultValueWidget() alters it.
// @todo Remove this when https://www.drupal.org/project/drupal/issues/3464035 is fixed.
if (!$field_definition->isNew()) {
$field_definition = \Drupal::entityTypeManager()
->getStorage('field_config')
->loadUnchanged($field_definition->id());
}
$field_name = $field_definition->getName();
$parents = ['third_party_settings', 'required_api', 'required_plugin'];
$manager = \Drupal::service('plugin.manager.required_api.required');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment