Wappler Version : 3.0.3
Operating System : Windows 10
Expected behavior
This issue seems to be only for queries that have at least 2 tables JOINED in the query and use at least 1 Alias
When you apply dynamic sorting on a table using a DB query, you expect it to work on all columns, even ones that you give an ‘Alias’ to in the query builder.
Actual behavior
When dynamic sorting is set up, it will only sort on the columns that DO NOT have an alias set up in the query builder.
Any column that you have given an Alias too will not work and will fail with following (extract) message:
order by \"call_types\".\"callName\" desc limit $1 - column call_types.callName does not exist\n at Parser.parseErrorMessage
Where call_types is the table name and “callName” is the Alias
How to reproduce
-
Create DB query that has at least 2 tables
-
Give an Alias to half of the columns
-
Create a table in app connect and apply sortable headers/dynamic sorting as per normal
-
Test the sorting on the different columns. The ones that use an Alias will NOT work and will cause an error
here is a snapshot of a sample query:
In this example, the sortable headers work fine for item # 3, work_group_id but all ones with an Alias will fail. If this query did not have a join, it would also work, even with the Alias
Last updated: