Support » Plugin: RSVPMaker » Database query looking for meta in wp_posts table

  • I get a list of sql errors but they are all related to looking for meta_key and meta_value in the wp_posts table instead of the wp_postmeta table. I did just upgrade, but I think WP has been keeping the meta in a separate table before this version.
    Am I correct? Are you aware of this? Any chance you might be planning on updating?
    If not, it’s OK (I realize it’s a free plugin!), but if you are, I wouldn’t spend the same effort working on the code myself. . .
    Thanks!

    WordPress database error: [Unknown column ‘meta_key’ in ‘where clause’]
    SELECT DISTINCT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = ‘7049’) AND wp_posts.post_type = ‘page’ AND meta_key=’_rsvp_dates’ AND meta_value >= ‘2018-03-01’ AND meta_value < DATE_ADD(‘2018-03-01’,INTERVAL 180 DAY) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC

    WordPress database error: [Unknown column ‘meta_key’ in ‘where clause’]
    SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘tp_event’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘closed’ OR wp_posts.post_status = ‘expired’ OR wp_posts.post_status = ‘tp-event-upcoming’ OR wp_posts.post_status = ‘tp-event-happenning’ OR wp_posts.post_status = ‘tp-event-expired’ OR wp_posts.post_status = ‘ea-cancelled’ OR wp_posts.post_status = ‘ea-pending’ OR wp_posts.post_status = ‘ea-processing’ OR wp_posts.post_status = ‘ea-completed’ OR wp_posts.post_status = ‘private’ OR wp_posts.post_status = ‘hidden’) AND meta_key=’_rsvp_dates’ AND meta_value >= ‘2018-03-01’ AND meta_value < DATE_ADD(‘2018-03-01’,INTERVAL 180 DAY) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10

Viewing 1 replies (of 1 total)
  • Plugin Author davidfcarr

    (@davidfcarr)

    I haven’t seen that error, but I will try to fix it. What’s the context where this is displayed? The SQL is wrong (should include a join between the posts and postmeta tables) but I don’t understand why it is coming out that way.

    Are you using some other plugin that could be interfering? I see a bunch of different post_status items in the SQL that are not coming from RSVPMaker.

    Example – wp_posts.post_status = ‘ea-cancelled’

    Normally, I would expect any public listing to select for post_status=’publish’

Viewing 1 replies (of 1 total)
  • The topic ‘Database query looking for meta in wp_posts table’ is closed to new replies.