• Resolved ChiefAlchemist

    (@chiefalchemist)


    I’m dev’ing with debug on and am getting this error when searching post (on the admin side).

    BTW, why are you appending here anyway? Shouldn’t you be checking to see if the search is against tribe_events? $_GET[] can tell you that, yes?

    WordPress database error: [Not unique table/alias: ‘wp_postmeta’]

    SELECT DISTINCT wp_posts.*, IF (wp_posts.post_type = ‘tribe_events’, wp_postmeta.meta_value, wp_posts.post_date) AS post_date FROM wp_posts LEFT 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_name = ‘events’ AND wp_posts.post_parent = 0 AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘product’, ‘tribe_venue’, ‘tribe_events’) AND ((wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘inherit’ OR wp_posts.post_status = ‘private’)) ORDER BY post_date DESC

Viewing 3 replies - 1 through 3 (of 3 total)
  • Ed

    (@erishel)

    Hey there,

    Thanks for reaching out ??

    Sorry for the wait! We’ve been experiencing a high volume of support requests.

    Is TEC calling this query? I get a different query on my sites. There are a few queries being run site-wide, but not seeing this one. Can you share the enitre list of queries?

    I’m not sure why wp_postmeta is being aliased as it’s own name.

    When running the query, we check if it is the main query, then we do in fact get the post type.

    Does this happen with all other plugins disabled?

    Take care,
    Ed ??

    Hey there,

    Since this topic has been inactive for a while, I’m going to mark it as resolved. Feel free to reply or create a new topic if you still need help.

    Take care,
    Ed ??

    Thread Starter ChiefAlchemist

    (@chiefalchemist)

    Hey Ed –

    Sorry. I’ve since forgotten about this. Best I could remember, there’s something wonky about the way the query is constructed (i.e., appending). But I don’t recall the details at this point.

    Oh well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress database error: [Not unique table/alias: ‘wp_postmeta’]’ is closed to new replies.