- Issue created by @darvanen
- π¦πΊAustralia darvanen Sydney, Australia
Inside this fork I've made an attempt at a test, but I ran into a different error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_field_data_nid' in 'order clause': SELECT "node_field_data"."nid" AS "nid" FROM "test53838627node_field_data" "node_field_data" WHERE "nid" NOT IN (SELECT "node_field_data"."nid" AS "nid" FROM "test53838627node_field_data" "node_field_data" LEFT JOIN "test53838627node__field_date" "node__field_date" ON node_field_data.nid = node__field_date.entity_id AND (node__field_date.deleted = :views_join_condition_0 AND node__field_date.langcode = node_field_data.langcode) WHERE (DATE_FORMAT(node__field_date.field_date_value, '%Y-%m-%d') >= DATE_FORMAT('2023-11-18T12:14:47', '%Y-%m-%d')) ORDER BY "node_field_data_nid" ASC); Array ( [:views_join_condition_0] => 0 )
When I print the view query before making a subquery of it, the field alias is correct:
SELECT "node_field_data"."nid" AS "node_field_data_nid", "node_field_data"."nid" AS "nid" FROM {node_field_data} "node_field_data" LEFT JOIN {node__field_date} "node__field_date" ON node_field_data.nid = node__field_date.entity_id AND (node__field_date.deleted = :views_join_condition_0 AND node__field_date.langcode = node_field_data.langcode) WHERE (DATE_FORMAT(node__field_date.field_date_value, '%Y-%m-%d') >= DATE_FORMAT('2023-11-18T13:11:20', '%Y-%m-%d')) ORDER BY "node_field_data_nid" ASC
So there's some funny business happening with subqueries and field aliases, and now I'm quite lost :)