Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4525 closed defect (bug) (invalid)

atom comment feed has sql error in title

Reported by: trombonekenny's profile trombonekenny Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords:
Focuses: Cc:

Description

When building the atom comment feed with 2.2.1 I get the following error when it tries to get the title:

<p class='wpdberror'><strong>WordPress database error:</strong> [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 &#039;AND
comment_approved = &#039;1&#039;&#039; at line 2]<br />

<code>SELECT

COUNT(*) FROM wp_comments WHERE comment_post_ID = AND
comment_approved = &#039;1&#039;</code></p>

My MySQL is an older 4.0 build, but it looks like a variable isn't getting evaluated where it should be. Here's a larger section of the output:

<?xml version="1.0" encoding="utf-8" ?><feed
	xmlns="http://www.w3.org/2005/Atom"
	xml:lang="en"
	>
	<title type="text">Comments for Recently, it's been like this...</title>
	<subtitle type="text">A blog.  You know, a weblog.  
</subtitle>

	<updated>2007-06-24T17:58:50Z</updated>
	<generator uri="http://wordpress.org/" version="2.2.1">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://www-dave.cs.uiuc.edu/wordpress" />

	<link rel="self" type="application/atom+xml" href="http://www-dave.cs.uiuc.edu/wordpress/comments/feed/atom/" />
	<id>http://www-dave.cs.uiuc.edu/wordpress/comments/feed/atom/</id>

	<entry>
		<title><div id='error'>
			<p class='wpdberror'><strong>WordPress database error:</strong> [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 &#039;AND
comment_approved = &#039;1&#039;&#039; at line 2]<br />
			<code>SELECT
COUNT(*) FROM wp_comments WHERE comment_post_ID =  AND
comment_approved = &#039;1&#039;</code></p>
			</div>Comment on &#8220;Farnum, Christ knows he&#8217;s earned it&#8221; by Tony</title>
		<link rel="alternate" href="http://www-dave.cs.uiuc.edu/wordpress/2007/06/22/farnum-christ-knows-hes-earned-it/#comment-43975" type="text/html" />

		<author>
			<name>Tony</name>

			<uri>http://protected.com</uri>
		</author>

		<id>http://www-dave.cs.uiuc.edu/wordpress/2007/06/22/farnum-christ-knows-hes-earned-it/#comment-43975</id>
		<updated>2007-06-23T14:40:32Z</updated>
		<published>2007-06-23T14:40:32Z</published>

Change History (4)

#1 @foolswisdom
17 years ago

  • Milestone set to 2.4 (future)

#2 @trombonekenny
17 years ago

The RSS 2.0 feed has this same error.

#3 @trombonekenny
17 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Ooops, figured out it was an old custom plugin that hooked into the_title_rss that was breaking things. Doesn't appear to be WP core related. Sorry.

#4 @foolswisdom
17 years ago

  • Milestone 2.4 (future) deleted
Note: See TracTickets for help on using tickets.