Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293292

Sort options should correspond to bundles selected for entity reference field settings

$
0
0

Problem/Motivation

This is a portion of #2900409: [Meta] Improve UI of Reference field settings form, separated out after comment #133.

When you are setting up an entity reference field, you usually only select 1 bundle or maybe a couple of similar bundles to be referenced. It is then somewhat jarring when you go to choose the sort options in the settings dialog, and you are shown all kinds of fields that are not present on these bundles, or have labels on the chosen bundles that are different from the labels that are shown.

Proposed resolution

Limit the field choices in the Sort By select list to fields that are on the selected bundles. Also, display the field label that is in use on those bundles; or, if there is more than one label in use, the most commonly-used label in use on those bundles.

Remaining tasks

  • Fix the failing tests.
  • Check the screenshots and update if needed.

User interface changes

Sort options will correspond to the selected bundles in entity reference field settings.

Before: this screenshot shows the title field with the label "Recipe name" even though only the Vendor content type is selected:

screenshot showing "Recipe name" as an available sort option


After: with a little help from browser tools to show both widgets at the same time, the Vendor content type is selected and the title field is displayed as "Vendor name":

screenshot showing "Vendor name" as an available sort option

See Comment #9 for additional screenshots.

API changes

None.

Data model changes

None.

Release notes snippet

Probably not necessary.


Viewing all articles
Browse latest Browse all 293292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>