keystonejs/keystone-classic
View on GitHubSort by relationship always sorts by _id of related field even though name is rendered in admin UI
Open
#4251 opened on May 1, 2017
bughelp wanted
Description
Expected behavior
When sorting by a relationship field, the sort should be alphabetical by the string that is actually rendered in the admin UI.
Actual/Current behavior
Currently the support appears to be alphabetical by the ObjectId.toString() value of the related document's _id property.
Steps to reproduce the actual/current behavior
- Create two Lists and include a String name property on each.
- Create relationship between one List and the other (
many: false) and setdefaultSorton the relationship owner to the property name of the relationship. - Create a number of documents for the related List with various
namevalues. - Access the admin ui for that List and observe the sort.
Environment
| Software | Version |
|---|---|
| Keystone | 4.0.0-beta.5 |
| Node | 7.6.0 |