Skip to content
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

Order mailings for selects in search and reports by id DESC #26436

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

larssandergreen
Copy link
Contributor

Overview

Mailing name selects (in Advanced Search, various reports) are ordered by name. Assuming you have more than a few mailings, this is not very useful. If I'm searching for mailings and I start typing the name of the mailing, I want to see the most recent mailings at the top of the list, not have them sorted by name. This also allows the user to select the most recent mailings directly from the top of the list.

Before

Mailing selects sorted by name.

After

Mailing selects are sorted by mailing id descending, so most recent mailings are at the top of the list.

Technical Details

This function is only used in CRM/Mailings/BAO/Query (it has another use in here, but the order doesn't matter for that) and the five Mailing reports. No other uses in universe except one similar use in a report in SendGrid extension.

@civibot
Copy link

civibot bot commented Jun 4, 2023

(Standard links)

@civibot civibot bot added the master label Jun 4, 2023
@larssandergreen larssandergreen changed the title Order select for mailings by id DESC Order mailings for selects in search and reports by id DESC Jun 5, 2023
@aydun
Copy link
Contributor

aydun commented Jun 5, 2023

Good idea

@aydun aydun merged commit 5739d5c into civicrm:master Jun 5, 2023
@Stoob
Copy link
Contributor

Stoob commented Jun 17, 2023

i
Added for illustration

@larssandergreen
Copy link
Contributor Author

@Stoob Are those not ordered by mailing id (which should be the same ordering as created date)? Or are you saying we should do something more complex that orders by scheduled date if present, but modified or created date if not? I like id because it is guaranteed fast and that's not the case if ordered by multiple non-indexed fields.

@Stoob
Copy link
Contributor

Stoob commented Jun 18, 2023

My comment was for illustrative purposes only, showing how they mailings are currently ordered alphanumberic asc by name. I personally think yours is a good proposal to order mailings by ID desc instead. I have asked a few clients to review this proposal as well

@magnolia61
Copy link
Contributor

Nice one! I agree and would also suggest ordering by sent (primary), scheduled (secondary).

PS. Same applies for ordering of event registrations.

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

Successfully merging this pull request may close these issues.

4 participants