Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the entity reference module only displays the available options in the multivalue select widget in the order they were created. Once you start adding a lot of node options to the select field, this becomes unmanageable. Being able to sort by the node title would make life much easier. Even if it changed the only sort method from creation date to title, that would be a huge improvement
Module is still awesome without this sort. Just figured a quick line of code might make things easier for some.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1339136-entityreference-sort.patch | 3.88 KB | Damien Tournoud |
Comments
Comment #1
amateescu CreditAttribution: amateescu commentedThis should be possible once #1253776: Add views support for providing a list of entities or bundles (views filtering, relationships, etc) gets fixed.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedActually, we could implement this without Views.
Proposed patch attached. Testing welcome.
Comment #3
amateescu CreditAttribution: amateescu commentedTested this and it works very well :)
Comment #4
Rick Hood CreditAttribution: Rick Hood commentedAlso confirming this patch worked for me. Thank you!
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedOk, then. Thanks for testing! Merged into 7.x-1.x.