Ticket #5435 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

Incorrect id, self link and alternate link in the Atom comment feed of each entry

Reported by: peaceablewhale Assigned to: ryan
Priority: normal Milestone: 2.5
Component: General Version:
Severity: normal Keywords: Atom, Comment Feed, has-patch
Cc:

Description

The id, self link and alternate link in the Atom comment feed of each entry is incorrect. Using an entry of the WordPress development blog, http://wordpress.org/development/2007/10/wordpress-231/feed/atom/, as an example:

The following code is not correct...

<id>http://wordpress.org/development/comments/feed/atom/</id>
<link rel="self" type="application/atom+xml" href="http://wordpress.org/development/comments/feed/atom/" />
<link rel="alternate" type="text/html" href="http://wordpress.org/development" />

The correct code should be...

<id>http://wordpress.org/development/2007/10/wordpress-231/feed/atom/</id>
<link rel="self" type="application/atom+xml" href="http://wordpress.org/development/2007/10/wordpress-231/feed/atom/" />
<link rel="alternate" type="text/html" href="http://wordpress.org/development/2007/10/wordpress-231/#comments" />

Does anybody know how to correct them?

Attachments

fix_atom_comments_metadata.patch (1.0 kB) - added by ionfish on 12/07/07 10:26:03.

Change History

12/07/07 10:26:03 changed by ionfish

  • attachment fix_atom_comments_metadata.patch added.

(follow-up: ↓ 2 ) 12/07/07 10:27:42 changed by ionfish

  • keywords changed from Atom, Comment Feed to Atom, Comment Feed, has-patch.
  • owner changed from anonymous to ionfish.
  • status changed from new to assigned.
  • severity changed from major to normal.

(in reply to: ↑ 1 ) 12/07/07 13:54:04 changed by peaceablewhale

Replying to ionfish: Thanks for the fix. I have a comment on it:

the_permalink(); returns the permalink of the entry only. Should the alternate link refer to the comment part of the entry by adding "#comments" after the permalink?

12/07/07 14:07:13 changed by ionfish

  • owner changed from ionfish to ryan.
  • status changed from assigned to new.

Not all templates have an element with the id 'comments', but I imagine the developer who commits the fix will add it (or mention it here) if they feel it's appropriate (I suppose it would be in line with the behaviour of some other links functions).

Ideally we'd also include self and alternate links and id values for searches as well, rather than simply using the root values, but that was beyond the scope of the five minutes I had to write this in. We probably need a search_feed_link() function (a noticeable omission from r6365); I might make a new ticket and set about writing one.

12/07/07 22:49:34 changed by Viper007Bond

A #comments anchor obviously isn't required for a theme, but WordPress assumes it's there when it creates many links (such as the comments link).

12/19/07 18:25:22 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6414]) Fix id, self link and alternate link in Atom comment feeds. Props ionfish. fixes #5435