I create new submission of terms of taxonomy, I choose a field the term of taxonomy (name), I note to use aggregation, I add communication of Representative node and I receive the following mistake:
Drupal\Core\Database\DatabaseExceptionWrapper: Exception in SQLSTATE[42S22]: Column not found: 1054 Unknown column 'taxonomy_term_field_data.tid1' in 'where clause': SELECT taxonomy_term_field_data.name AS taxonomy_term_field_data_name, COUNT(node_field_data_taxonomy_term_field_data.nid) AS node_field_data_taxonomy_term_field_data_nid, MIN(taxonomy_term_field_data.tid) AS tid, MIN(node_taxonomy_index.nid) AS node_taxonomy_index_nid, MIN(node_field_data_taxonomy_term_field_data.nid) AS node_field_data_taxonomy_term_field_data_nid_1 FROM {taxonomy_term_field_data} taxonomy_term_field_data LEFT JOIN {taxonomy_index} taxonomy_index ON taxonomy_term_field_data.tid = taxonomy_index.tid INNER JOIN {node} node_taxonomy_index ON taxonomy_index.nid = node_taxonomy_index.nid LEFT JOIN {node_field_data} node_field_data_taxonomy_term_field_data ON (SELECT node_field_dataINNER.nid AS nidINNER FROM {node_field_data} node_field_dataINNER LEFT JOIN {taxonomy_index} taxonomy_indexINNER ON "node_field_dataINNER".nid = "taxonomy_indexINNER".nid LEFT JOIN {taxonomy_term_field_data} taxonomy_term_field_data_node_field_dataINNER ON "taxonomy_indexINNER".tid = "taxonomy_term_field_data_node_field_dataINNER".tid WHERE (( ("taxonomy_term_field_data_node_field_dataINNER".tid = taxonomy_term_field_data.tid1 ) )) ORDER BY node_field_dataINNER.nid DESC LIMIT 1 OFFSET 0) = node_field_data_taxonomy_term_field_data.nid WHERE (( (taxonomy_term_field_data.vid IN (:db_condition_placeholder_0)) )) GROUP BY taxonomy_term_field_data_name LIMIT 5 OFFSET 0; Array ( [:db_condition_placeholder_0] => category ) in Drupal\views\Plugin\views\query\Sql->execute() (line 1457 of core\modules\views\src\Plugin\views\query\Sql.php).
Comments
Comment #2
alexboy89 commentedComment #3
mustanggb commentedComment #4
Vlad_Bo commentedIt's also reproduced without aggregation and on 8.1.3 version. Resaving relationship fixes the problem, but after cache flushing it appears again.
Comment #5
bbu23Comment #6
dawehnerI believe this is basically a duplicate of #2379423: Representative Node Views fails due to invalid SQL
Comment #7
quietone commentedUpdating tags per Issue tags field and Issue tags -- special tags for issue #3565085: Drupal core issue tag cleanup.
Comment #8
quietone commented