Enabling plugin breaks default WP search when "Reed Write" plugin is also active

Home Forums Calendar Products Events Calendar PRO Enabling plugin breaks default WP search when "Reed Write" plugin is also active

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #138610
    cslinfotech
    Participant

    There’s a plugin conflict with a plugin called “Reed Write”. Disabling that plugin causes this problem to immediately go away, but I’m documenting it anyway in case there’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 search to return 0 results. Firing up the WP_Debug tools, I see this query returning an error:

    SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = ‘tribe_events’, 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 = ‘_EventStartDate’ WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%a%’) OR (wp_postmeta.meta_value LIKE ‘%a%’) OR (wp_posts.post_content LIKE ‘%a%’))) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘rw_content_type’, ‘rw_taxonomy’, ‘faculty’, ‘tribe_events’) AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_title LIKE ‘%a%’ DESC, post_date DESC LIMIT 0, 10

    You will notice a couple other custom post types in there (the ones that begin with “rw_” come from Reed Write), as well as a search value of “a”, 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’s only when both are active that I see the problem.

    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 “wp_postmeta”, which is already being used by the previous join. Changing the second join:

    LEFT JOIN wp_postmeta as wp_postmeta on wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = ‘_EventStartDate’

    to this:

    LEFT JOIN wp_postmeta as wp_postmeta2 on wp_posts.ID = wp_postmeta2.post_id AND wp_postmeta2.meta_key = ‘_EventStartDate’

    causes the query to run successfully and return the expected rows.

    I’m not sure how you guys (or the Reed Write people) are hooking into the WP search engine, but I’m hoping you can patch it so I can have both plugins active. We’re using Reed Write to manage our custom post types and taxonomies. I’m comfortable moving all that into functions.php or a custom plugin to handle it manually, but I’d rather just apply a patch and forget about it! 🙂

    Is there anything else I can do that would assist you guys in patching this?

    #139484
    Casey D
    Member

    Hi cslinfotech, thanks for reaching out!

    I did some quick homework, as I was uncertain with the plugin and this problem.

    I was only able to find related support posts, but the plugin itself seems to be gone. 🙁

    Since the plugin is old/nonexistent, I’m not sure we can offer a specific patch concerning that plugin.

    But since you might have tripped a bigger issue (and you put so much effort into it), I’d like to notify our devs to see if there is something they can do.

    Can you get us a zip of the plugin? Emailing it to [email protected] will work out well.

    Thanks a ton!

    – Casey Driscoll

    #153837
    Casey D
    Member

    Hello cslinfotech,

    We typically close threads after there is no activity after two weeks. Feel free to create a new thread at any time, and reference this one to save you time.

    Cheers!

    – Casey Driscoll

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Enabling plugin breaks default WP search when "Reed Write" plugin is also active’ is closed to new replies.