workflow
workflow copied to clipboard
Error when setting default sort order to "Editor"
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
- Make sure
CRAFT_ALLOW_ADMIN_CHANGESis set totrue - In the main menu click on "Workflow"
- Click on the settings icon on the left and then "Customize sources"
- 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.
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.
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?
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.