Provide alter for the field type UI definitions

Created on 14 December 2023, 10 months ago

Problem/Motivation

The Field UX work is changing the form structures. One of the valid use cases we realized can currently achieved only by altering the form was modifying field types available through the UI for a specific entity type. For example, comment module is disabling the comment field type from entity types that are not compatible with the comment module. Doing this via form alter is brittle, in particular now that we are introducing changes to the Field UI.

Proposed resolution

Use modals in field creation and field edit flow Needs work approached this by providing a new alter for the field type UI definitions, that allows altering the field type UI definitions dynamically depending on the entity type. However, this was done directly in the Field UI. This issue is proposing to do this in \Drupal\Core\Field\FieldTypePluginManager by adding a new method so that this information is available to other UIs without having to explicitly trigger the alter hook.

Remaining tasks

User interface changes

API changes

New alter hook: hook_field_info_entity_type_ui_definitions_alter.
New method to retrieve the UI definitions per entity type: \Drupal\Core\Field\FieldTypePluginManagerInterface::getEntityTypeUiDefinitions

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.2

Component
Field 

Last updated about 14 hours ago

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
  • Field UX

    Usability improvements related to the Field UI

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024