Lens withCount and sortable field fails on sort #6645
Unanswered
FN-FAL113
asked this question in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
When a query utilizes
withCount
and making a fieldsortable
, the raw sql query that gets added by #sortable function prefixes an aliased subquery field with the table name which causes an error:Error Code: 1054. Unknown column 'categories.products_count' in 'order clause'
I am not sure if the query is sql version dependent but I'm thinking that aliased fields should not be prefixed since its not a default table field.
Faulty
Working
Detailed steps to reproduce the issue on a fresh Nova installation:
Create lens class
Define the query and filter just like in the image below and also making the aliased field sortable
Sort the field in the actual nova application in the browser
Beta Was this translation helpful? Give feedback.
All reactions