Skip to content

[5.x]: Sorting element index by custom field only works on first click #15434

@tommysvr

Description

@tommysvr

What happened?

Description

Sorting the entries index by a custom field only works the first time.

Steps to reproduce

  1. Add a custom Date/Number field to a channel
  2. Click on the column header to sort
  3. First sorting works, subsequent clicks have no affect
  4. The same is true when using the View dropdown

Expected behavior

Clicking again will change the sorting order to ascending/descending.

Actual behavior

Only the initial sort using custom fields works. Sorting based on the title works as expected. No errors are produced in the logs/browser console.

Likely related to #15335 / #15297 and 29d55d8

screenshot_2024_07_29._11.19.mp4

Craft CMS version

5.2.8

PHP version

8.2

Operating system and version

No response

Database type and version

MySQL 8.0

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions