Skip to content

Conversation

@sylvesterdamgaard
Copy link
Contributor

@sylvesterdamgaard sylvesterdamgaard commented Jul 2, 2024

Submissions are not sortable due to this query which expects the date to be in the data.
This issue is a regression from #306 where the date field is grabbed from the created_at column instead.

Result is that old submissions are sortable due to having a date property in data, but new entries do not.

Current query.
select * from form_submissions where form = 'tip_os' order by json_unquote(json_extract(data, '$."date"')) desc limit 100 offset 0

This PR changes the query builder to use the created_at column for sorting

The new query will look like this:
select * from form_submissions where form = 'tip_os' order by created_at desc limit 100 offset 0

@sylvesterdamgaard sylvesterdamgaard changed the title use created_at column for the date. use created_at column for submission sorting Jul 2, 2024
@ryanmitchell ryanmitchell merged commit d8527e6 into statamic:master Jul 2, 2024
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.

2 participants