Skip to content

Fix Media Browser Sorting by Modification Date #16734

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

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from

Conversation

smg6511
Copy link
Collaborator

@smg6511 smg6511 commented Apr 17, 2025

What does it do?

Adds raw, unformatted date data into store for use in sorting.

Why is it needed?

Some custom formatted date strings can break proper sorting.

How to test

Open Media Browser and select a folder with several files. When choosing to sort by Last Modified, files should show in descending order (you can only check this by selecting each file and taking note of the date in the right details panel).

Related issue(s)/PR(s)

Resolves #16731

smg6511 added 3 commits April 17, 2025 11:25
Code style fixes, modernization, and optimizations only.
Remove duplicate load listener (with non-dup function). This was added in modxcms#16394. The newer load listener never gets called because it precedes another one.
Add new unmodified date field for sorting purposes only
@smg6511 smg6511 requested review from opengeek and Mark-H as code owners April 17, 2025 16:03
Copy link
Member

@opengeek opengeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave the reformatted code in modx.browser.js file out of this for now? Is there actually a change in that file related to this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect sorting by "Last Modified" in MODX browser
2 participants