Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

AtomFeedBuilder renders not valid xml when using options[:xml]

#1836

When using atom_feed in standalone app:

atom_feed({ :id => 1, :root_url => 'root_url', :language => 'pl_PL', :url => 'some_url', :xml => Builder::XmlMarkup.new}) do |feed| ...

renders:

<?xml version="1.0" encoding="UTF-8"?><feed<to_s/> xml="<?xml version="1.0" encoding="UTF-8"?><inspect/><feed<to_s/>" xml:lang="pl_PL" xmlns="http://www.w3.org/2005/Atom">

which is not valid. This is due line 144 in atom_feed_helper.rb: feed_opts.merge!(options).reject!{|k,v| !k.to_s.match(/^xml/)} It doesn't rejectes (but should) options[:xml].

Reported by Wiktor Gworek · February 1st, 2009 @ 11:47 AM

State: committed
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
  2. chucknelson
    chucknelson

    -1 I don't know how important this really is. I'm don't understand why you would pass an xml option to atom_feed, hence the wacky output. If that is something that may happen, would you change that regular expression to expect an option of xml + something else ("xml-myoption")?

    August 8th, 2009 @ 11:21 PM

  3. Michael Koziarski
    Michael Koziarski
    • Tag cleared.
    • State changed from new to resolved

    Fixed in 370bf1401af62c8589d557cd51b9533dd603c463

    August 9th, 2009 @ 02:19 AM

  4. Repository
    Repository
    • State changed from resolved to committed

    (from [796b7c6ce62559be253b8a2c8ff2a6e447a60d7f]) Don't call additional methods on builders passed to the atom_feed helper.

    Additionally, actually test that the atom_feed helper works with :xml as an option.

    [#1836 state:committed] http://github.com/rails/rails/commit/796b7c6ce62559be253b8a2c8ff2a6...

    August 9th, 2009 @ 05:27 AM

  5. Repository
    Repository

    (from [370bf1401af62c8589d557cd51b9533dd603c463]) Don't call additional methods on builders passed to the atom_feed helper.

    Additionally, actually test that the atom_feed helper works with :xml as an option.

    [#1836 state:committed] http://github.com/rails/rails/commit/370bf1401af62c8589d557cd51b953...

    August 9th, 2009 @ 05:27 AM