• Resolved cnasal

    (@cnasal)


    When someone visits a /feed/ URL, I see in our Apache error logs the following error:

    AH01071: Got error ‘PHP message: WordPress database error Unknown column ‘post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘966’ AND comment_approved = ‘1’ AND comment_type != ‘order_note’ AND comment_type != ‘webhook_delivery’ AND post_type != ‘sensei_message’ AND wp_comments.comment_type != ‘action_log’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, QM_DB->query\n’

    I tracked it down to Sensei, and I’m pretty sure it’s specifically this code in plugins/sensei-lms/includes/class-sensei-messages.php:

    add_filter( 'comment_feed_where', array( $this, 'exclude_message_comments_from_feed_where' ) );
    
    // ...
    
            public function exclude_message_comments_from_feed_where( $where ) {
                    return $where . ( $where ? ' AND ' : '' ) . " post_type != 'sensei_message' ";
            }

    The wp_comments table doesn’t have a post_type field. Could you check on that?

    Thanks,
    Carl

    • This topic was modified 5 years, 4 months ago by cnasal.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘DB Error on Feeds’ is closed to new replies.