Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when setting default sort order to "Editor" #221

Open
tricki opened this issue Dec 4, 2024 · 3 comments
Open

Error when setting default sort order to "Editor" #221

tricki opened this issue Dec 4, 2024 · 3 comments

Comments

@tricki
Copy link

tricki commented Dec 4, 2024

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.

@engram-design
Copy link
Member

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.

@tricki
Copy link
Author

tricki commented Dec 5, 2024

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?

@engram-design
Copy link
Member

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.

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

No branches or pull requests

2 participants