Make WordPress Core

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#311 closed enhancement (fixed)

trackbacks get written to DB with empty values

Reported by: bronski's profile bronski Owned by: michel-v's profile michel v
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

trackbacks to posts never show up in the blog, but they are in the databse. Looking at wordpress_comments you can see all trackbacks have a post_ID of "0" and almost all other values are empty.

The reason for that is wp-trackback.php and wp-includes/functions-post.php make inconsistant use of variables. wp-trackback.php uses comment_post_id, wp-includes/functions-post.php uses both comment_post_id and comment_post_ID. The final insert into the database uses comment_post_ID, and so does wp-comments-post.php. That is why comments get written into database with the correct ID and trackbacks with an ID of "0".

While the variables comment_author, comment_author_email, comment_author_url, comment_content, comment_type still have the correct values in wp-trackback.php those values get lost in wp-includes/functions-post.php. this only happens for trackbacks and not for comments.

And btw.: wp-trackback.php uses commment_author (with 3 m) instead of comment_author.

Attachments (3)

0000311-functions-post.diff (1.2 KB) - added by bronski 20 years ago.
0000311-functions-post2.diff (519 bytes) - added by bronski 20 years ago.
0000311-wp-trackback.diff (2.7 KB) - added by bronski 20 years ago.

Download all attachments as: .zip

Change History (7)

#2 @bronski
21 years ago

The two attached diffs make trackback work for me.

Comments and trackbacks seem to use a complete different set of variable names, comment uses author, email, url, and trackback comment_author, comment_author_email, comment_author_url etc.

#3 @bronski
21 years ago

I missed a thing... check_comment is testing for $url, but the insert-statement is using $tb_url. Which obviously works well with comments?! The patch above is not linking the trackback for that reason.

#4 @anonymousbugger
21 years ago

Thank you for the patches and for bringing this to our attention!

#5 @michel v
21 years ago

  • Owner changed from anonymous to michel v
  • Resolution changed from 10 to 20
  • Status changed from new to closed

(The previous comment was by me, heh.)
Someone feel free to close this bug once it has been verified that the issues are not present anymore, I'm marking it fixed for now.

Note: See TracTickets for help on using tickets.