Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring non-manual sort order for the o2m style interfaces #18076

Open
rijkvanzanten opened this issue Apr 5, 2023 Discussed in #12771 · 1 comment
Open

Allow configuring non-manual sort order for the o2m style interfaces #18076

rijkvanzanten opened this issue Apr 5, 2023 Discussed in #12771 · 1 comment

Comments

@rijkvanzanten
Copy link
Member

Discussed in #12771

Originally posted by paulboudewijn November 19, 2021
When no sort field is configured for a relation, the PK is used as the default sort field instead of using the field(s) used in the display template. This results in a seemingly random list of items in the m2m interface.

I have a PR ready.

To Reproduce

  1. Create a 'book' collection with the 'title' and 'subtitle' fields
  2. Create an 'author' collection
  3. Create a m2m relation between 'author' and 'book', without sortfield and interface displaytemplate
  4. Note that the m2m interface list 'books' on the 'author' collection is sorted by the PK field
  5. Add displaytemplate {{book_id.title}} - {{book_id.subtitle}} to the interface
  6. Note that the m2m interface list is still sorted in the PK field, although title and subtitle alphabetically could suggest otherwise
  7. Add a sort field sort to the relation
  8. Note that the interface list is sorted on this column (as expected)
@LevelUpGit
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants