revolution icon indicating copy to clipboard operation
revolution copied to clipboard

Fix Media Browser Sorting by Modification Date (Follow-up)

Open smg6511 opened this issue 3 months ago • 5 comments

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:

  1. Main browser: Click on the Media Browser link in the main menu
  2. RTE browser: Click to add an image in your content's RTE
  3. File/Image TV within a Resource: Click to find file

Related issue(s)/PR(s)

In response to request in Issue #16731

smg6511 avatar Sep 18 '25 17:09 smg6511

@jenswittmann - Hey, since you pointed out the issue fixed here, can you pull down this PR to test it sometime soon? Thx!

smg6511 avatar Sep 18 '25 17:09 smg6511

Hej @smg6511, thank you very much for fixing the bug so quickly! I tested and it works 👍🏽

jenswittmann avatar Sep 18 '25 19:09 jenswittmann

@jenswittmann - You're most welcome! If you would, give the PR an official review approval so this can get merged in sooner than later.

smg6511 avatar Sep 18 '25 20:09 smg6511

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

modxcommunity avatar Nov 21 '25 02:11 modxcommunity

@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.

smg6511 avatar Dec 10 '25 14:12 smg6511