Tablesort does not override default sort on export

Created on 27 February 2022, almost 3 years ago
Updated 31 July 2023, over 1 year ago

Problem/Motivation

#2893689: Tablesorts not applied to export β†’ fixed an issue where tablesorts from parent displays weren't applied when exporting data. This works well if the export display doesn't have any sorts itself, but if there are then the tablesort effectively does nothing.

For example, I have an export which is ordered by descending updated date, my main display also defaults to this. If I then tablesort by the Title and export that it still has the order by updated date.

If I remove the default sort from the export display then it works fine except if I try and export before doing any tablesort the export isn't sorted at all.

Steps to reproduce

  1. Create a view with a table and export
  2. Add default sorts to both displays by changed date, and allow table sorting by Title
  3. Sort by title and export
  4. Notice export is not ordered by title
  5. Remove default sort from export
  6. Load page and do not tablesort
  7. Export and notice it is not sorted at all.

Proposed resolution

Override existing sorts in buildSortPost, OR apply the default sort from the parent if no tablesort has been done.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024