[wp-trac] [WordPress Trac] #37696: WP_Comment_Query loses sql_clauses with Object Cache
WordPress Trac
noreply at wordpress.org
Mon Aug 22 19:54:50 UTC 2016
#37696: WP_Comment_Query loses sql_clauses with Object Cache
--------------------------+---------------------------
Reporter: Rarst | Owner: boonebgorges
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.6.1
Component: Comments | Version: 4.6
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+---------------------------
Changes (by Akeif):
* keywords: has-patch needs-testing => has-patch
Comment:
'''First''': Thanks to @danielkanchev for setting a test account.
'''Second''': I was able to reproduce the problem and apply the patch,
which fix the issue.
Watch this screen cast if to see the error and patch in action:
https://www.youtube.com/watch?v=SjLC_O-2tfo
I also tested upgrading, downgrading WordPress but haven't seen any
problem there.
I'm removing the `need-testing` keyword since @Rarst and myself were able
to confirm the fix.
Here's the SQL error output from `Query Monitor` plugin (and I'm attaching
a screenshot).
{{{
SELECT wpbj_comments.comment_ID, wpbj_comments.comment_parent
WHERE
AND comment_parent IN (1,2)
ORDER BY comment_date_gmt ASC, comment_ID ASC
WP_Comment_Query->fill_descendants()
wp-includes/class-wp-comment-query.php:999
WP_Comment_Query->get_comments()
wp-includes/class-wp-comment-query.php:471
WP_Comment_Query->query()
wp-includes/class-wp-comment-query.php:357
WP_Comment_Query->__construct()
wp-includes/class-wp-comment-query.php:311
comments_template()
wp-includes/comment-template.php:1407 Core You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'WHERE AND comment_parent IN (1,2) ORDER
BY comment_date_gmt ASC, comment_ID AS' at line 1
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37696#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list