This project is archived and is in readonly mode.

#1093 ✓wontfix
Jonny_K

Atom Feed Helper generates wrong Ids

Reported by Jonny_K | September 22nd, 2008 @ 07:37 PM | in 2.x

Hi!

I think I ran into a bug in the atom feed helper. In my application I have a Blog that can have Comments and I want a atom feed for all the comments.

I create this feed with the atom feed helper:


...
feed.entry([comment.blog,comment]) do |entry|
      entry.title(comment.title)
      entry.content(comment.body, :type => 'html')

      entry.author do |author|
        author.name(comment.user.name)
      end
    end
...

This code generates a valid atom feed but it generates wrong ids for the entries. For instance tag:arche-online.at,2005:Array/-612666458

So the rss reader always marks every comment as new comment because the id changes.

When I change this code to


feed.entry(comment) do |entry|
      ...

it fails creating the URL for this comment.

In the atom_feed_helper.rb I found this (line 122)


@xml.id(options[:id] || "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}")

It's obvious that this is creating the id of the array and not of the object.

I don't know what a good solution for this would be. So i would appreciate some help on that.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages