Fix Media Browser Sorting by Modification Date (Follow-up)
Ensures system settings' modx_browser_default_sort is properly applied when 'lastmod' is chosen.
What does it do?
Accounts for recently-implemented lastmod_raw key in the browser logic; allows users who have their default sort set to lastmod to not have to make any changes for that setting to work.
Why is it needed?
When system setting is set to lastmod, browser views were still being sorted by name on initial load.
How to test
Change your modx_browser_default_sort to each of the three variations allowed and ensure sorting appears as expected in each of the browser contexts:
- Main browser: Click on the Media Browser link in the main menu
- RTE browser: Click to add an image in your content's RTE
- File/Image TV within a Resource: Click to find file
Related issue(s)/PR(s)
In response to request in Issue #16731
@jenswittmann - Hey, since you pointed out the issue fixed here, can you pull down this PR to test it sometime soon? Thx!
Hej @smg6511, thank you very much for fixing the bug so quickly! I tested and it works 👍🏽
@jenswittmann - You're most welcome! If you would, give the PR an official review approval so this can get merged in sooner than later.
This pull request has been mentioned on MODX Community. There might be relevant details there:
https://community.modx.com/t/problems-in-the-media-browser-not-sorting-by-last-modified/8499/5
@opengeek - We've got one review on this one and you'd be able to easily verify to be sure, as it's a very small change; it'd be nice for this to work properly in the next release.