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.

[PATCH] Fix Hash#from_xml with empty hash (using REXML backend)

#3205

Prior to XmlMini, the following behavior existed:

Hash.from_xml({}.to_xml) # => {"hash"=>nil}

Currently, however, this is what happens when using REXML (Nokogiri works correctly):

Hash.from_xml({}.to_xml) # => {"hash"=>"\n"}

The attached patch fixes this issue.

Reported by codebrulee · September 15th, 2009 @ 04:11 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. codebrulee
    codebrulee
    • Tag changed from patch to 2.3.x, activesupport, from_xml, master, patch

    This is a patch against master, but I feel that it should be included in the 2.3.5 release (if at all possible) since it is a regression for 2.3.x.

    September 15th, 2009 @ 02:39 PM

  2. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3.x, activesupport, from_xml, master, patch to 2.3.x, activesupport, bugmash, from_xml, master, patch

    September 25th, 2009 @ 12:11 PM

  3. John Pignata
    John Pignata

    +1 verified - applies cleanly to master

    September 27th, 2009 @ 05:12 AM

  4. sr.iniv.t
    sr.iniv.t

    +1 verified on master.

    Patch applies cleanly only on master, but fails on 2-3-stable. Will try to upload a patch for 2-3-stable.

    September 27th, 2009 @ 05:32 AM

  5. Elad Meidar
    Elad Meidar

    +1 verified on master and 2-3-stable Master patch applies cleanly and tests pass.
    i've attached a patch for 2-3-stable.

    September 27th, 2009 @ 06:17 AM

  6. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3.x, activesupport, bugmash, from_xml, master, patch to 2.3.x, activesupport, bugmash-review, from_xml, master, patch

    September 27th, 2009 @ 12:04 PM

  7. Rizwan Reza
    Rizwan Reza
    • Tag changed from 2.3.x, activesupport, bugmash-review, from_xml, master, patch to 2.3.x, activesupport, bugmash, from_xml, master, patch

    May 15th, 2010 @ 06:45 PM

  8. Enrico Bianco
    Enrico Bianco

    +1 to the 2-3-stable patch.

    Applies cleanly and all activesupport tests pass.

    May 15th, 2010 @ 09:16 PM

  9. Neeraj Singh
    Neeraj Singh

    I would say that fix should be on the conversion side.

    ruby-1.8.7-p249 > {}.to_xml
     => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<hash>\n</hash>\n"
    

    The output in the above case should not have \n .

    Rather than try to fix it on the parsing side, to_xml should be fixed. Just my thought.

    May 15th, 2010 @ 09:55 PM

  10. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Tag changed from 2.3.x, activesupport, bugmash, from_xml, master, patch to 23x, activesupport, bugmash, from_xml, master, patch
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:38 PM

  11. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:38 PM

  12. joson
    joson

    A Replica Breitling is a timepiece of high quality and functionality and you will have all the class, prestige and luxury of a wealthy, successful individual. By choosing from our selection of luxury Replica Watches , you can improve your self-esteem and feel confident to enter new circles of business associates and friends. These Rolex Replicas will surely enhance your style and only you will know the watch you wear did not cost you $1,000's of dollars.

    April 29th, 2011 @ 09:13 AM