Show field/field-storage summary instead of field type on field listings

Created on 24 March 2015, almost 10 years ago
Updated 8 September 2023, over 1 year ago

Problem/Motivation

From #1847596-266: Remove Taxonomy term reference field in favor of Entity reference โ†’

I noticed a minor labeling inconsistency while updating the hook_help(). When you add a field, you select Taxonomy term under References in the Add Field UI. However, once you've configured the field, it's listed simply as Entity reference with no indication that it has anything to do with taxonomy. I don't think that's worth blocking this patch on, but it might be worth a followup issue. (Really it'd actually be a followup to #2446511: Add a "preconfigured field options" concept in Field UI โ†’ I think.)

Proposed resolution

  1. Remove the link from the entries in the "Field type" column. It duplicates a link already available from the drop button in the Operations column.
  2. Provide a way for field-type plugins to give additional information. Default to the label of the field type.
  3. Implement this for Reference types. This affects File, Image, and other references.
  4. Also add this information as a new column on the "Field list" page (/admin/reports/fields).

Remaining tasks

  • Add a change record.
  • Subsystem maintainer review
  • Follow-up issues as described in #75, #78, #110

User interface changes

With the MR, the "Manage Fields" page now looks like this:

The Field report (/admin/reports/fields) gets a new Summary column with the information added by this issue:

API changes

  1. Add fieldSettingsSummary() and storageSettingsSummary() methods to Drupal/Core/Field/FieldItemInterface.
  2. Give default implementations of these methods in Drupal/Core/Field/FieldItemBase.
  3. Implement both methods in Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem, showing "Entity reference" and the targeted entity type.
  4. Add getFieldSettingsSummary() and getStorageSettingsSummary() methods to Drupal/Core/Field/FieldTypePluginManagerInterface.
  5. Implement these methods in Drupal/Core/Field/FieldTypePluginManager. These methods call the two new methods in FieldItemInterface.
  6. Update the buildHeader() and buildRow() methods in Drupal/field_ui/src/FieldConfigListBuilder and Drupal/field_ui/src/FieldStorageConfigListBuilder to use the new methods.
๐Ÿ“Œ Task
Status

Fixed

Version

10.1 โœจ

Component
Fieldย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada jibran Toronto, Canada

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Field UX

    Usability improvements related to the Field UI

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024