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.
A feature change to add new entity references to top of list instead of the bottom
Comments
Comment #3
Ace Cooper CreditAttribution: Ace Cooper as a volunteer commentedGot the same request from our content manager this week.
We add anywhere from 10 to 500 items into the entityreference field, and sometimes we come back to add more later. So the idea was on the entity edit form to display the newly added items at the top of the table.
For this you only need a simple one line change.
Don't even think this deserves a patch, because it is quick and dirty.
Find the following line from
function entityreference_view_widget_ajax
inentityreference_view_widget.module
:and change the order of merging arrays: