{"id":907,"date":"2022-08-30T15:09:10","date_gmt":"2022-08-30T15:09:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/sql-error-on-calendar-view-with-relationships-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:09:10","modified_gmt":"2022-08-30T15:09:10","slug":"sql-error-on-calendar-view-with-relationships-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/sql-error-on-calendar-view-with-relationships-collection-of-common-programming-errors\/","title":{"rendered":"SQL Error on Calendar View with Relationships-Collection of common programming errors"},"content":{"rendered":"<p>I have a calendar set up to show a date field from nodes that I get using relationships.<\/p>\n<p>The relationship goes:<\/p>\n<p>Application &gt; Discipline &gt; School &gt; Date Field<\/p>\n<p>In my view I get this error when attempting to use that date field as an argument in the Calendar:<\/p>\n<pre><code>user warning: Unknown column 'node_data_field_school_term_deadline.field_school_term_deadline_value' in 'where clause' query: SELECT DISTINCT node.nid AS nid, node.title AS node_title, node.created AS node_created, node_node_data_field_discipline_school_node_data_field_school_term_deadline.field_school_term_deadline_value AS node_node_data_field_discipline_school_node_data_field_school_term_deadline_field_school_term_deadline_value, node_node_data_field_discipline_school.nid AS node_node_data_field_discipline_school_nid, node_node_data_field_discipline_school.type AS node_node_data_field_discipline_school_type, node_node_data_field_discipline_school.vid AS node_node_data_field_discipline_school_vid, node.changed AS node_changed, node.type AS node_type FROM node node LEFT JOIN content_type_application node_data_field_application_discipline_id ON node.vid = node_data_field_application_discipline_id.vid INNER JOIN node node_node_data_field_application_discipline_id ON node_data_field_application_discipline_id.field_application_discipline_id_nid = node_node_data_field_application_discipline_id.nid LEFT JOIN content_type_discipline node_node_data_field_application_discipline_id_node_data_field_discipline_school ON node_node_data_field_application_discipline_id.vid = node_node_data_field_application_discipline_id_node_data_field_discipline_school.vid INNER JOIN node node_node_data_field_discipline_school ON node_node_data_field_application_discipline_id_node_data_field_discipline_school.field_discipline_school_nid = node_node_data_field_discipline_school.nid INNER JOIN users users ON node.uid = users.uid LEFT JOIN content_type_school node_node_data_field_discipline_school_node_data_field_school_term_deadline ON node_node_data_field_discipline_school.vid = node_node_data_field_discipline_school_node_data_field_school_term_deadline.vid WHERE ((node.status = 1) AND (node.type in ('application')) AND (users.uid = 1)) AND ((DATE_FORMAT(STR_TO_DATE(node_data_field_school_term_deadline.field_school_term_deadline_value, '%Y-%m-%dT%T'), '%Y-%m') = '2011-12')) ORDER BY node_changed ASC in \/var\/www\/clients\/client4\/web39\/web\/sites\/all\/modules\/views\/includes\/view.inc on line 799.\n<\/code><\/pre>\n<p>I&#8217;m not sure why it would be an unknown column. I don&#8217;t know sql very well so I don&#8217;t know where to begin when debugging this.<\/p>\n<p>Any suggestions?<\/p>\n<ol>\n<li>\n<p>Have you recently deleted a field which name was <code>field_school_term_deadline<\/code> ? If so your view used it and is broken now, just remove it from the list of fields.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:56:59. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have a calendar set up to show a date field from nodes that I get using relationships. The relationship goes: Application &gt; Discipline &gt; School &gt; Date Field In my view I get this error when attempting to use that date field as an argument in the Calendar: user warning: Unknown column &#8216;node_data_field_school_term_deadline.field_school_term_deadline_value&#8217; in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-907","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=907"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/907\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}