Skip to content
Snippets Groups Projects

Issues/3419186: Add hook_ENTITY_TYPE_form_mode_alter().

1 file
+ 9
0
Compare changes
  • Side-by-side
  • Inline
@@ -49,3 +49,12 @@ function entity_test_delete_bundle($bundle, $entity_type = 'entity_test'): void
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\entity_test\EntityTestHelper::deleteBundle() instead. See https://www.drupal.org/node/3497049', E_USER_DEPRECATED);
EntityTestHelper::deleteBundle($bundle, $entity_type);
}
/**
* Implements hook_ENTITY_TYPE_form_mode_alter().
*/
function entity_test_entity_test_form_mode_alter(&$form_mode, EntityInterface $entity): void {
if ($entity->getEntityTypeId() === 'entity_test' && $entity->get('name')->value === 'test_entity_type_form_mode_alter') {
$form_mode = 'compact';
}
}
Loading