[wp-trac] [WordPress Trac] #32761: Fatal error: Call to undefined method WP_Meta_Query::get_clauses() in /wp-includes/comment.php

WordPress Trac noreply at wordpress.org
Tue Jun 23 11:51:10 UTC 2015


#32761: Fatal error: Call to undefined method WP_Meta_Query::get_clauses() in /wp-
includes/comment.php
--------------------------+-----------------------------
 Reporter:  novazembla    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  4.2.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi,

 I just upgraded one of my websites from WP 4.1.1 to 4.2.2 since this
 upgrade I get the following error while loading the comments.php of my
 custom theme. I've disabled all comments related plugins (Akismet &
 Disqus) and still get the error. Unfortunately I cannot provide steps to
 reproduce the error on a blank install.

 Fatal error: Call to undefined method WP_Meta_Query::get_clauses() in
 /path-to-website-root/wp-includes/comment.php on line 962

 A websearch finds many blogs with a similar error message but no solution.
 I believe that it might be a core bug. While I don't know the inner
 workings of the comment engine and especially the use of the in WP 4.2
 introduced get_clauses wrapping the error producing fragment into a
 method_exists call avoids the error

 {{{
 if (method_exists($this->meta_query, "get_clauses")){
   $meta_query_clauses = $this->meta_query->get_clauses();
   if ( $meta_query_clauses ) {
     $allowed_keys = array_merge( $allowed_keys, array_keys(
 $meta_query_clauses ) );
   }
 }
 }}}

 Many thanks!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32761>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list