≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1227

Bug #1227: Atom feeds all broken after Rails 2.3.0 RC1 update

Kind bug
Product wincent.dev
When Created 2009-02-15T03:05:26Z, updated 2009-02-17T05:18:52Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

I just noticed that in local testing my Atom feeds on issues are all broken: instead of just the Atom feed I'm seeing the the HTML application layout, with the atom feed embedded inside it within the "content" div.

I double-checked to make sure that feeds are correct on the live site and they are.

At this stage not sure if this is just some weird glitch in my local setup only, or if there is actually a regression that's crept in to the code since the last deployment.

So opening this ticket to serve as a reminder to keep an eye on this. If I can't identify the cause before the next deployment, will want to keep a very close eye on things to make sure that feeds still work after deploying.

Comments

  1. Greg Hurrell 2009-02-15T03:05:35Z

    Status changed:

    • From: New
    • To: Open
  2. Greg Hurrell 2009-02-15T03:11:11Z

    Lo and behold, this is breakage caused by changes in Rails 2.3.0.

    Previously the following did the right thing:

    format.atom { @comments = @issue.visible_comments }

    Looks like now we need:

    format.atom {
      @comments = @issue.visible_comments
      render :layout => false
    }
  3. Greg Hurrell 2009-02-15T03:22:00Z

    I've posted a question to the talk list to ask whether this is a bug/regression in Rails, or whether the new behaviour is intended as an "enhancement". See:

    • http://groups.google.com/group/rubyonrails-talk/t/d2d150c8219e5814

    In the meantime, this is an additional incentive to add feed validation to my spec suite to catch this kind of regression in the future.

  4. Greg Hurrell 2009-02-15T03:26:06Z

    If it turns out that this is not a bug, this page from the guides might help with a way of specifying the correct layout (none) in only one place, instead of repeating render :layout => false in every single action of every single controller where I produce an Atom feed.

    Possibly could make an (empty) application.atom layout and see if that gets picked up automatically. Or use the layout method in the application controller with a Proc.

  5. Greg Hurrell 2009-02-15T03:31:14Z

    Just tested, unfortunately a layout at app/views/layouts/application.builder containing only yield doesn't work. The rendered feed is completely blank.

  6. Greg Hurrell 2009-02-16T05:56:18Z

    Back to testing this again and in the server log you see:

    Rendering template within layouts/application
    Rendering issues/show

    The thing is, layout/application is actually layout/application.haml so I have no idea why the Haml template is being chosen...

  7. Greg Hurrell 2009-02-16T06:06:07Z

    Looks like the following in my application_controller.rb is one way to do an application-wide override for Atom feeds:

    layout Proc.new { |controller| controller.send(:is_atom?) ? false : 'application' }

    Still a mystery why this used to work pre-2.3.0 and now requires a special override.

  8. Greg Hurrell 2009-02-16T06:11:34Z

    Going to go with that workaround for now, so will mark as "closed" unless some older and wiser on the Rails Google group points out the error in my ways.

  9. Greg Hurrell 2009-02-16T06:11:38Z

    Status changed:

    • From: Open
    • To: Closed
  10. Greg Hurrell 2009-02-16T06:12:05Z

    Summary changed:

    • From: Broken issue feeds in development version?
    • To: Atom feeds all broken after Rails 2.3.0 RC1 update
  11. Greg Hurrell 2009-02-17T05:18:52Z

    Have now added specs to catch this kind of breakage in the future.

    See "Testing validity of Rails feeds with RSpec".

Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets