OrderBy on translated records doesn't work properly
I looked for a similar issue in the bugtracker and I wondered that I couldn't find any report for this problem. Im my opinion it shouldn't be an unusual case, so if I'm just reporting a known issue please feel free to delete this report.
I'm trying to get all localized records from the repository ordered by their "title"-attribute.
The records are ordered by their title in default language, instead by their translated title.
The ordering takes place when the records with sys_language_uid = 0 are requested from db ("ORDER BY"-clause). The language overlay for the current language is done later, without any ordering-reimplementation.
I'm not sure what's the best way to fix the problem. Sorting the translated record after doing the language-overlay is more an hack than a practicable way to fix this issue, and not performant at all. I hope that anybody has a better idea, how to handle this.
[FEATURE] Improved translation handling for statement generation
When selecting items in a language other than default one, the
relations (e.g. for IRRE) can not be resolved correctly. This
fix adds the current language if handling is enabled for the chosen
table. Besides it corrects the ordering of items as it selects all
possible ones. For correct overlay the origin is fetched before.
Reviewed-by: Jochen Rau
Tested-by: Jochen Rau
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn