Representative Node Relationship Query Missing Variables

Created on 27 February 2018, over 6 years ago
Updated 28 February 2023, over 1 year ago

Hello,

Recently, I tried creating a view with a "Representative Node" relationships, sorted by image field, (delta, target_id, alt).

However, looking at the error, it looks like, it is missing two variables: :views_join_condition_0 & :views_join_condition_2.

Error:
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT taxonomy_term_field_data.weight AS taxonomy_term_field_data_weight, taxonomy_term_field_data.tid AS tid, node_field_data_taxonomy_term_field_data.nid AS node_field_data_taxonomy_term_field_data_nid FROM {taxonomy_term_field_data} taxonomy_term_field_data 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 LEFT JOIN {node__field_images} node__field_imagesINNER ON "node_field_dataINNER".nid = "node__field_imagesINNER".entity_id AND node__field_imagesINNER".deleted = ":views_join_condition_0 AND (node__field_imagesINNER".langcode = "node_field_dataINNER".langcode OR node__field_imagesINNER".bundle = :views_join_condition_2) WHERE ("taxonomy_term_field_data_node_field_dataINNER".tid = taxonomy_term_field_data.tid ) ORDER BY node__field_imagesINNER.delta DESC LIMIT 1 OFFSET 0) = node_field_data_taxonomy_term_field_data.nid WHERE (taxonomy_term_field_data.vid IN (:db_condition_placeholder_0)) AND (taxonomy_term_field_data.weight < :db_condition_placeholder_1) ORDER BY taxonomy_term_field_data_weight ASC; Array ( [:db_condition_placeholder_0] => article_origin [:db_condition_placeholder_1] => 6 )

Original Query:

SELECT taxonomy_term_field_data.weight AS taxonomy_term_field_data_weight, taxonomy_term_field_data.tid AS tid, node_field_data_taxonomy_term_field_data.nid AS node_field_data_taxonomy_term_field_data_nid
FROM 
{taxonomy_term_field_data} taxonomy_term_field_data
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
LEFT JOIN {node__field_images} node__field_imagesINNER ON "node_field_dataINNER".nid = "node__field_imagesINNER".entity_id AND node__field_imagesINNER".deleted = ":views_join_condition_0 AND (node__field_imagesINNER".langcode = "node_field_dataINNER".langcode OR node__field_imagesINNER".bundle = :views_join_condition_2)
WHERE ("taxonomy_term_field_data_node_field_dataINNER".tid = taxonomy_term_field_data.tid )
ORDER BY node__field_imagesINNER.delta DESC
LIMIT 1 OFFSET 0) = node_field_data_taxonomy_term_field_data.nid
WHERE (taxonomy_term_field_data.vid IN ('article_origin')) AND (taxonomy_term_field_data.weight < '6')
ORDER BY taxonomy_term_field_data_weight ASC
πŸ› Bug report
Status

Closed: cannot reproduce

Version

9.5

Component
ViewsΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡¨πŸ‡¦Canada Nathan Tsai

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" more than 3 months ago and there has been no activity since that time.

    Since this needs more information which has not provided and 3 months has passed, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active" [or "Needs Work" if it has a patch, etc.].

    Thanks!

Production build 0.71.5 2024