{"id":82635,"date":"2013-12-18T16:30:53","date_gmt":"2013-12-19T00:30:53","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/"},"modified":"2013-12-18T16:31:52","modified_gmt":"2013-12-19T00:31:52","slug":"wordpress-database-error-not-unique-tablealias-2","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/","title":{"rendered":"WordPress database error Not unique table\/alias"},"content":{"rendered":"<p>Ever since a client of our updated this plugin we&#8217;re now running up against this error:<\/p>\n<p>[18-Dec-2013 23:54:23 UTC] WordPress database error Not unique table\/alias: &#8216;wp_postmeta&#8217; for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = &#8216;tribe_events&#8217;, wp_postmeta.meta_value, wp_posts.post_date) AS post_date FROM wp_posts  INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) LEFT JOIN wp_postmeta on wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = &#8216;_EventStartDate&#8217; WHERE 1=1  AND wp_posts.post_type IN (&#8216;post&#8217;, &#8216;page&#8217;, &#8216;tribe_events&#8217;) AND (wp_posts.post_status = &#8216;publish&#8217; OR wp_posts.post_author = 2 AND wp_posts.post_status = &#8216;private&#8217;) AND ( (wp_postmeta.meta_key = &#8216;_feature&#8217; AND CAST(wp_postmeta.meta_value AS CHAR) = &#8216;on&#8217;) )  ORDER BY post_date DESC LIMIT 0, 10 made by require(&#8216;wp-blog-header.php&#8217;), require_once(&#8216;wp-includes\/template-loader.php&#8217;), include(&#8216;\/themes\/redDoorProject\/front-page.php&#8217;), get_footer, locate_template, load_template, require_once(&#8216;\/themes\/redDoorProject\/footer.php&#8217;), include(&#8216;\/themes\/redDoorProject\/includes\/feature.php&#8217;), WP_Query-&gt;__construct, WP_Query-&gt;query, WP_Query-&gt;get_posts<\/p>\n<p>which is preventing the entire feature to fail at displaying posts.<\/p>\n<p>the WP_Query that is being used is:<\/p>\n<p>$the_query = new WP_Query(<br \/>\n\tarray(<br \/>\n\t\t&#8216;post_type&#8217; =&gt; array(<br \/>\n\t\t\t&#8216;post&#8217;,<br \/>\n\t\t\t&#8216;page&#8217;,<br \/>\n\t\t\t&#8216;tribe_events&#8217;<br \/>\n\t\t),<br \/>\n\t\t&#8216;meta_query&#8217; =&gt; array(<br \/>\n\t\t\tarray(<br \/>\n\t\t\t\t&#8216;key&#8217; =&gt; &#8216;_feature&#8217;,<br \/>\n\t\t\t\t&#8216;value&#8217; =&gt; &#8216;on&#8217;<br \/>\n\t\t\t)<br \/>\n\t\t),<br \/>\n\t)<br \/>\n); <\/p>\n<p>Only content with the custom meta value of &#8216;_feature&#8217; should be display, yet none are.<\/p>\n<p>If I remove the &#8216;tribe_events&#8217; from the WP_Query&#8217;s &#8216;post_type&#8217; array, then the feature successfully shows all posts and pages that have the &#8216;_featured&#8217; custom meta checked.<\/p>\n<p>Please advise.<br \/>\n-M<\/p>\n","protected":false},"template":"","class_list":["post-82635","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WordPress database error Not unique table\/alias -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress database error Not unique table\/alias -\" \/>\n<meta property=\"og:description\" content=\"Ever since a client of our updated this plugin we&#8217;re now running up against this error: [18-Dec-2013 23:54:23 UTC] WordPress database error Not unique table\/alias: &#8216;wp_postmeta&#8217; for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = &#8216;tribe_events&#8217;, wp_postmeta.meta_value, wp_posts.post_date) AS post_date FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) LEFT JOIN wp_postmeta on wp_posts.ID = [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/\" \/>\n<meta property=\"article:modified_time\" content=\"2013-12-19T00:31:52+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/\",\"name\":\"WordPress database error Not unique table\/alias -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2013-12-19T00:30:53+00:00\",\"dateModified\":\"2013-12-19T00:31:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"WordPress database error Not unique table\/alias\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress database error Not unique table\/alias -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/","og_locale":"en_US","og_type":"article","og_title":"WordPress database error Not unique table\/alias -","og_description":"Ever since a client of our updated this plugin we&#8217;re now running up against this error: [18-Dec-2013 23:54:23 UTC] WordPress database error Not unique table\/alias: &#8216;wp_postmeta&#8217; for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = &#8216;tribe_events&#8217;, wp_postmeta.meta_value, wp_posts.post_date) AS post_date FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) LEFT JOIN wp_postmeta on wp_posts.ID = [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/","article_modified_time":"2013-12-19T00:31:52+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/","name":"WordPress database error Not unique table\/alias -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2013-12-19T00:30:53+00:00","dateModified":"2013-12-19T00:31:52+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wordpress-database-error-not-unique-tablealias-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"WordPress database error Not unique table\/alias"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/82635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/82635\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=82635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}