{"id":138610,"date":"2014-04-21T10:11:53","date_gmt":"2014-04-21T17:11:53","guid":{"rendered":"https:\/\/tri.be\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/"},"modified":"2014-05-08T08:01:17","modified_gmt":"2014-05-08T15:01:17","slug":"enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/","title":{"rendered":"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active"},"content":{"rendered":"<p>There&#8217;s a plugin conflict with a plugin called &#8220;Reed Write&#8221;. Disabling that plugin causes this problem to immediately go away, but I&#8217;m documenting it anyway in case there&#8217;s something you guys can do.<\/p>\n<p>Enabling the Events Calendar plugin (just core, not Pro) when Reed Write is also active causes all searches using the built-in WP search to return 0 results. Firing up the WP_Debug tools, I see this query returning an error:<\/p>\n<blockquote><p>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 RIGHT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id LEFT JOIN wp_postmeta as 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_title LIKE &#8216;%a%&#8217;) OR (wp_postmeta.meta_value LIKE &#8216;%a%&#8217;) OR (wp_posts.post_content LIKE &#8216;%a%&#8217;))) AND wp_posts.post_type IN (&#8216;post&#8217;, &#8216;page&#8217;, &#8216;attachment&#8217;, &#8216;rw_content_type&#8217;, &#8216;rw_taxonomy&#8217;, &#8216;faculty&#8217;, &#8216;tribe_events&#8217;) AND (wp_posts.post_status = &#8216;publish&#8217; OR wp_posts.post_status = &#8216;private&#8217;) ORDER BY wp_posts.post_title LIKE &#8216;%a%&#8217; DESC, post_date DESC LIMIT 0, 10<\/p><\/blockquote>\n<p>You will notice a couple other custom post types in there (the ones that begin with &#8220;rw_&#8221; come from Reed Write), as well as a search value of &#8220;a&#8221;, which should definitely return some kind of result. Disabling the Events Calendar plugin causes the search to return successfully. Disabling Reed Write also causes the search to complete. It&#8217;s only when both are active that I see the problem.<\/p>\n<p>In taking apart the SQL query above, I see two joins from wp_post to wp_postmeta: in the first one (the RIGHT JOIN), the table name is referenced directly. In the second join (the LEFT JOIN), the table is given an alias of &#8220;wp_postmeta&#8221;, which is already being used by the previous join. Changing the second join:<\/p>\n<blockquote><p>LEFT JOIN wp_postmeta as wp_postmeta on wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = &#8216;_EventStartDate&#8217;<\/p><\/blockquote>\n<p>to this:<\/p>\n<blockquote><p>LEFT JOIN wp_postmeta as wp_postmeta2 on wp_posts.ID = wp_postmeta2.post_id AND wp_postmeta2.meta_key = &#8216;_EventStartDate&#8217;<\/p><\/blockquote>\n<p>causes the query to run successfully and return the expected rows.<\/p>\n<p>I&#8217;m not sure how you guys (or the Reed Write people) are hooking into the WP search engine, but I&#8217;m hoping you can patch it so I can have both plugins active. We&#8217;re using Reed Write to manage our custom post types and taxonomies. I&#8217;m comfortable moving all that into functions.php or a custom plugin to handle it manually, but I&#8217;d rather just apply a patch and forget about it! \ud83d\ude42<\/p>\n<p>Is there anything else I can do that would assist you guys in patching this?<\/p>\n","protected":false},"template":"","class_list":["post-138610","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>Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active -<\/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\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active -\" \/>\n<meta property=\"og:description\" content=\"There&#8217;s a plugin conflict with a plugin called &#8220;Reed Write&#8221;. Disabling that plugin causes this problem to immediately go away, but I&#8217;m documenting it anyway in case there&#8217;s something you guys can do. Enabling the Events Calendar plugin (just core, not Pro) when Reed Write is also active causes all searches using the built-in WP [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/\" \/>\n<meta property=\"article:modified_time\" content=\"2014-05-08T15:01:17+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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/\",\"name\":\"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-04-21T17:11:53+00:00\",\"dateModified\":\"2014-05-08T15:01:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/#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\":\"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active\"}]},{\"@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":"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active -","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\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/","og_locale":"en_US","og_type":"article","og_title":"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active -","og_description":"There&#8217;s a plugin conflict with a plugin called &#8220;Reed Write&#8221;. Disabling that plugin causes this problem to immediately go away, but I&#8217;m documenting it anyway in case there&#8217;s something you guys can do. Enabling the Events Calendar plugin (just core, not Pro) when Reed Write is also active causes all searches using the built-in WP [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/","article_modified_time":"2014-05-08T15:01:17+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/","name":"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-04-21T17:11:53+00:00","dateModified":"2014-05-08T15:01:17+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/enabling-plugin-breaks-default-wp-search-when-reed-write-plugin-is-also-active\/#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":"Enabling plugin breaks default WP search when &quot;Reed Write&quot; plugin is also active"}]},{"@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\/138610","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\/138610\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=138610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}