workflow icon indicating copy to clipboard operation
workflow copied to clipboard

Error when setting default sort order to "Editor"

Open tricki opened this issue 1 year ago • 3 comments

Describe the bug

When you change the default sort order on the "All submissions" list to "Editor" or "Reviewer", the following error is thrown:

Column not found: 1054 Unknown column 'editorId' in 'order clause'

Steps to reproduce

  1. Make sure CRAFT_ALLOW_ADMIN_CHANGES is set to true
  2. In the main menu click on "Workflow"
  3. Click on the settings icon on the left and then "Customize sources"
  4. Change the "Default Sort" to "Editor" or "Reviewer"

Craft CMS version

4.12.8

Plugin version

2.0.12

Multi-site?

Yes

Additional context

It looks to me from the migrations like that column once existed but was changed to userId.

tricki avatar Dec 04 '24 10:12 tricki

Ah, this might not actually be feasible anymore, due to how we're storing that against reviews. While we can order by the userId of the last review (which is what you see in that column), it's far more difficult to order by the visual name/email/username you see for a User element.

As such, I've had to remove those sort options for now.

engram-design avatar Dec 04 '24 20:12 engram-design

Makes sense, and manual sorting by those columns had already been disabled. But maybe it makes sense to allow sorting by the user IDs as a way of "grouping" by users?

tricki avatar Dec 05 '24 09:12 tricki

So that's a possibility, although it kinda produces results you wouldn't expect. A user with an ID of 1 will appear first, even if their name isn't alphabetically first, like you might expect with an element-based field.

engram-design avatar Dec 05 '24 09:12 engram-design