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

Sort type Newest for isues/pull request is not working #30642

Closed
PDuijst opened this issue Apr 22, 2024 · 2 comments · Fixed by #30644
Closed

Sort type Newest for isues/pull request is not working #30642

PDuijst opened this issue Apr 22, 2024 · 2 comments · Fixed by #30644
Labels

Comments

@PDuijst
Copy link

PDuijst commented Apr 22, 2024

Description

The sort Newest is sorting the same as "Recently updated".

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

1.21.11

Operating System

Linux

How are you running Gitea?

Building gitea by myself
OS: Ubuntu 22.04 LTS
gitea is running with systemd

Database

MSSQL

lunny pushed a commit that referenced this issue Apr 23, 2024
Should resolve #30642.

Before this commit, we were treating an empty `?sort=` query parameter
as the correct sorting type (which is to sort issues in descending order
by their created UNIX time). But when we perform `sort=latest`, we did
not include this as a type so we would sort by the most recently updated
when reaching the `default` switch statement block.

This commit fixes this by considering the empty string, "latest", and
just any other string that is not mentioned in the switch statement as
sorting by newest.
@PDuijst
Copy link
Author

PDuijst commented May 3, 2024

Thanks for the quick fix. Cherry-picked the commit into V1.21.11.

@lunny
Copy link
Member

lunny commented May 3, 2024

Added a label backport/v1.21 for #30644

GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue May 3, 2024
Should resolve go-gitea#30642.

Before this commit, we were treating an empty `?sort=` query parameter
as the correct sorting type (which is to sort issues in descending order
by their created UNIX time). But when we perform `sort=latest`, we did
not include this as a type so we would sort by the most recently updated
when reaching the `default` switch statement block.

This commit fixes this by considering the empty string, "latest", and
just any other string that is not mentioned in the switch statement as
sorting by newest.
wxiaoguang pushed a commit that referenced this issue May 3, 2024
Backport #30644 by kemzeb

Should resolve #30642.

Co-authored-by: Kemal Zebari <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants