As you can see in the image and the SQL snippet below, the list is sorted by name in descending order, which is the expected default.
order by `name` desc
Open page and sort by name `/files?sort=name
As you can see in the image and the SQL snippet below, the list is sorted by name in ascending order, which is specified in the URL.
order by `name` asc
Open page and sort by invalid field /files?sort=password
As you can see in the image, the list is sorted by name (actually by ID) in ascending order, which is not expected, as the default should be descending order. There is no order by specified in the sql query.
Expected Behavior
If none of the sort parameters in the URL are actually taken into account, because none of them is allowed, then the default sort should be used.
Actual Behavior
If I specify an invalid sort in the URL, the default sort will not be used.
Steps To Reproduce
Environment
Allow invalid sort parameters in query
Register sorting by name
Open page without sort query
/files
As you can see in the image and the SQL snippet below, the list is sorted by name in descending order, which is the expected default.
Open page and sort by name `/files?sort=name
As you can see in the image and the SQL snippet below, the list is sorted by name in ascending order, which is specified in the URL.
Open page and sort by invalid field
/files?sort=password
As you can see in the image, the list is sorted by name (actually by ID) in ascending order, which is not expected, as the default should be descending order. There is no
order by
specified in the sql query.