-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add support for transOrderBy #516
Conversation
@mjauvin @osmanzeki @datune could you guys review this please? @mjauvin once it's been reviewed and is deemed good please let me know so I can do a final review before merging this. |
@mjauvin is on vacation for the next few weeks so unless someone else reviews it it'll take a few weeks to get to this. |
@aurelien-roy sorry took me a while, but could you add unit test for |
Done :) |
@aurelien-roy since you modified |
@LukeTowers looks good to me! |
@mjauvin I don't see anything that stands out to me so if you've tested it and it works well feel free to merge when appropriate |
@LukeTowers @bennothommo I've tested this with the following OctoDock instance and it's working fine as far as I can see: https://d3f3b84cf746.octodock.com/backend I also ran the phpunit tests within the instance without issues. I'm ready to merge this if you have nothing further to add. |
@mjauvin Looks fine to me. It's new functionality, so its introduction shouldn't break anything. |
Thank you all for your time reviewing it! |
@@ -33,7 +33,7 @@ public function __construct($model) | |||
|
|||
/** | |||
* Applies a translatable index to a basic query. This scope will join the index | |||
* table and cannot be executed more than once. | |||
* table and can be executed neither more than once, nor with scopeTransOrder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjauvin what does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed... @aurelien-roy can you fix this comment so it makes sense?
* runs params value through htmlspecialchars() to escape html content * add note about escaped content in translated messages * use Html::clean() instead of e() * Revert "add note about escaped content in translated messages" * escape params when translating messages; introduce transRaw method for legacy usage * Fix for #376 (#559) Fix for #376 * Add support for transOrderBy (#516) Add support for transOrderBy * update version file for 1.6.8 release * Disable safe mode checks for ML Static Pages. Fixes rainlab/pages-plugin#434. Refs: rainlab/pages-plugin#174, rainlab/pages-plugin@6b6b061 * Clear RainLab.Pages caches when saving a static page Fixes rainlab/pages-plugin#404 * Register asset bundle (#560) * make sure multi-lingual input form controls have padding-right of 44px * register asset bundle to process less files into css files * reposition language selector above textarea box * fix language selector position when commentAbove is defined * Update version file for 1.6.9 release * Fix error with casts fields default locale value (#556) * only call setLocale() if locale has changed (#561) * remove unused module Co-authored-by: Siarhei Karavai <[email protected]> Co-authored-by: Aurélien Roy <[email protected]> Co-authored-by: Ben Thomson <[email protected]> Co-authored-by: Luke Towers <[email protected]> Co-authored-by: Trysystems <[email protected]>
These changes add a new method enabling models to be sorted by an indexed translatable field.
Use case : Print a list of items sorted by their name where name is a translatable field. Of course, sorting won't be the same from one language to another.
Example :
If a record hasn't be translated, the value from default locale will be used for sorting.