I have a normal "surname" and "firstname" fields, however I need something more than
->sort('field_surname', 'ASC') ->sort('field_firstname', 'ASC')
The surnames are old English names and contain prefixes to the names so a surname of "St John" would need to be sorted as "Saint John" to appear in the list in the correct place.
Other examples could contain an apostrophe which would need to be removed for the sort, but still displayed.
Ideally I’d like a nice pre-written module to do this, but suspect there’s not one.
Is there any way to add a custom sort to an entity query? I will probably need to use this same sort in a view so something that is re-usable (for example in a view) would be ideal.