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

Created on 24 March 2015, over 9 years ago
Updated 8 September 2023, 10 months 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 about 8 hours ago

Created by

๐Ÿ‡ต๐Ÿ‡ฐPakistan jibran Sydney, Australia

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.

  • The Needs Review Queue Bot โ†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo

    Rerolled #82

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • @hooroomoo opened merge request.
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States hooroomoo

    Opened an MR that applies patch #99, fixes the failed test, and added the new styling to the claro theme as well

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Updating the screenshot in the issue summary with a recent screenshot that uses Claro, and shows the bundle information that was just made visible by recent commits to the MR. ๐Ÿ˜‡

  • First commit to issue fork.
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tim.plunkett Philadelphia

    tim.plunkett โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tim.plunkett Philadelphia

    This infra commit fixed the composer issue

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    I brought this up with the usability group to discuss the "Target entity type" text. I had the impression that we generally avoid using the term "entity" in the UI whenever that's possible. It seems like that is the case, and for that reason the group recommends to use "Reference type" instead.

    Something else that the group suggested was looking into alternative ways of presenting the different summaries. Currently, they are displayed as a list and each item is on it's own line. However, from usability standpoint, it might be better to display them differently. Within the group there was consensus that this issue is a net win even without addressing this concern and therefore addressing these concerns could be left for a follow-up issue.

    This has also reviewed by the Usability group in the past, as documented in #78. As part of this, the group had reviewed the removal of the link.

    At the moment it is unclear to where the link is pointing, rendering it useless for most users. Removing the link may cause some friction for users who are who are accustomed to using the link for checking information about the field storage (i.e. cardinality). However, there is a pre-existing link to the same destination under the operations, with a much clearer link text. We may have to look into what other information users need from the field storage page as an additional follow-up.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

    We discussed this issue at ๐Ÿ“Œ Drupal Usability Meeting 2023-02-17 Fixed . That issue will have a link to a recording of the meeting. (See also #109.)

    For the record, the attendees at the usability meeting were @AaronMcHale, @BlackBamboo, @benjifisher, @gaurav mahlawat, @lauriii, @rkoller, @shaal, and @simohell.

    We specifically discussed the new text for an entity reference (ER) field. From the screenshot in the issue description โ†’ :

    Entity reference
    Referenced entity type: Media
    Media type: Image, Video

    For this issue, we would like to change "Referenced entity type" to "Reference type", as @lauriii said in #109. Either as part of this issue or as a follow-up, we would like to combine the first two lines. Some possibilities are "Media reference", "Reference: Media", or "Reference (Media)". Depending on which modules are enabled, some possibilities are two words or longer ("Taxonomy term", "Content moderation state", ...).

    One guideline is to be consistent with the forms for adding a new field and for editing the field-storage settings. When adding a field, the select list has "Reference" as a group header and Content, File, Image, ... as options in that group. When editing the field-storage settings, the text is "Type of item to reference".

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    This seems really close but this one feature seemed off

    Don't think these fields need a reference type right?

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Pushed commit which should address #111 ๐Ÿ‘

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    #111 has been fixed so +1 from me for RTBC.

    Not moving it for subsyste, framework manager, and usability review.

    Think after that happens change record can be written.

    Also was tagged for follow up 4 years ago if that still needs to happen.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Opened follow-up issues:

    1. ๐Ÿ“Œ [PP-1] Remove unused $entity_type_manager constructor argument from \Drupal\field_ui\FieldConfigListBuilder Postponed
    2. ๐Ÿ“Œ [PP-1] Some of the field summaries are excessively verbose Active

    Based on #115, moving to RTBC for a framework manager review.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    This issue is required by ๐Ÿ› Improve re-use an existing field user experience Fixed .

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    This probably needs a non FE framework manager signoff as that's where most of the changes are, but this is looking good to me. It introduces some smaller than usual fonts in the details, but the .9rem is well above the 9px needed for AA compliance. I also tried this out with Paragraphs, and paragraphs fields in content types look great, as do fields within paragraphs.

    As unlikely a use case as this might be, may be worth if the CR includes info on the array returned by \Drupal\field_ui\FieldConfigListBuilder::buildHeader as it no longer returns a field_type key and now has settings_summary. I went through https://git.drupalcode.org/search to see if there's any evidence of this impacting contrib in any way, and it certainly doesn't look like it... it just seems like an easy enough base to cover.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Hiding patches since there's an MR.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia larowlan ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ.au GMT+10
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    Left a comment on the MR about the module stylesheet. If that's addressed with something simple like a selector change I'd say go ahead and switch back to RTBC after the change.

  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Addressed the feedback regarding the CSS selector.

    • bnjmnm โ†’ committed 9c7640c2 on 10.1.x
      Issue #2458127 by lauriii, benjifisher, hooroomoo, chrisfromredfin,...
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    After many high quality reviews from many excellent contributors, I've committed this to 10.1.x, and opting to not backport since it is a UI change that isn't addressing a bug.

    For context: This ticket was filed two months before the release of "Avengers: Age of Ultron" and "Mad Max: Fury Road" (which I saw right after returning from Drupalcon LA). The number one movie in the US on the actual date was "The Divergent Series: Insurgent". Nice work everyone, great to see this UX improvement added to core!

  • Status changed to Fixed about 1 year ago
  • Status changed to Fixed 10 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand

    Published change record

Production build 0.69.0 2024