Skip to content
Snippets Groups Projects
Commit 6e994b94 authored by git's avatar git Committed by Bruno de Oliveira Magalhaes
Browse files

Issue #2914250 by rvillan: Type property does not exist on all entity types

parent ac55302c
Branches
Tags 2.0.5
No related merge requests found
......@@ -276,7 +276,8 @@ function entity_draft_entity_type_submit(array &$form, FormStateInterface $form_
// Set required handling using controlled_fields.
$config_entity_type = $entity->getEntityType();
$bundle_of = $config_entity_type->getBundleOf();
$field_definitions = controlled_fields_fetch_field_definitions($bundle_of, $entity->get('type'));
$bundle = $entity->id();
$field_definitions = controlled_fields_fetch_field_definitions($bundle_of, $bundle);
$entity_manager = \Drupal::entityTypeManager();
$entity_display_repository = \Drupal::service('entity_display.repository');
......@@ -292,7 +293,7 @@ function entity_draft_entity_type_submit(array &$form, FormStateInterface $form_
}
foreach ($valid_form_modes as $form_mode_id) {
controlled_fields_enable_form_display($bundle_of, $entity->get('type'), $form_mode_id, $form_state->getValue('enable_draft'));
controlled_fields_enable_form_display($bundle_of, $bundle, $form_mode_id, $form_state->getValue('enable_draft'));
}
controlled_fields_field_config_change_required($field_definitions, $form_state->getValue('enable_draft'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment