Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#5435 closed defect (bug) (fixed)

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

Reported by: peaceablewhale's profile peaceablewhale Owned by: ryan's profile ryan
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: General Keywords: Atom, Comment Feed, has-patch
Focuses: 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 (1)

fix_atom_comments_metadata.patch (1.0 KB) - added by ionfish 16 years ago.

Download all attachments as: .zip

Change History (6)

#1 follow-up: @ionfish
16 years ago

  • Keywords has-patch added
  • Owner changed from anonymous to ionfish
  • Severity changed from major to normal
  • Status changed from new to assigned

#2 in reply to: ↑ 1 @peaceablewhale
16 years ago

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?

#3 @ionfish
16 years ago

  • 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.

#4 @Viper007Bond
16 years ago

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).

#5 @ryan
16 years ago

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

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

Note: See TracTickets for help on using tickets.