This project is archived and is in readonly mode.

#3217 open
Sidu Ponnappa

[PATCH] Parsing an xml file with multiple records and extra attributes (besides type) fails

Reported by Sidu Ponnappa | September 16th, 2009 @ 03:33 PM

This issue occurs when a collection is serialised to xml, and has attributes other than type='array' on the root node (for example is you choose to suppy page/per-page information for pagination as root attributes). This completely breaks ActiveResource when dealing with paginated collections.

I've taken the patch against rails/activesupport. I've changed Hash#typecast_xml_value to ignore extra attributes when 'type' is present. The sample data to reproduce the issue is included as part of the specs.

Comments and changes to this ticket

  • Dmitry Polushkin

    Dmitry Polushkin February 26th, 2010 @ 03:51 PM

    • Tag changed from activesupport, hash, xml to 2.3.6, activesupport, hash, xml
    • Assigned user set to “Jeremy Kemper”

    +1

  • Niranjan Paranjape

    Niranjan Paranjape September 23rd, 2010 @ 04:25 PM

    • Importance changed from “” to “”

    This problem persists in Rails 3.0.0

  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer October 10th, 2010 @ 08:11 PM

    • Title changed from “[Patch] Parsing an xml file with multiple records and extra attributes (besides type) fails” to “Parsing an xml file with multiple records and extra attributes (besides type) fails”
    • Tag changed from 2.3.6, activesupport, hash, xml to 2.3.6, activesupport, hash, patch, xml

    Using the "patch" tag instead of prefixing the ticket title with "[PATCH]" to make sure patched tickets end up in the open patches bin. :)

  • Rohit Arondekar

    Rohit Arondekar October 14th, 2010 @ 02:08 PM

    • State changed from “new” to “open”
    • Assigned user cleared.
    • Tag changed from 2.3.6, activesupport, hash, patch, xml to activesupport, hash, patch, xml
    • Importance changed from “” to “Low”

    Sidu, the patch doesn't apply any more. Can you rebase/rewrite it and follow http://rails.lighthouseapp.com/projects/8994/sending-patches so that you get credit? :)

    Also when the new patch comes, we need more then just a '+1'. If you are reviewing the patch please do comment on the code, whether it solves the problem and make sure the tests fail before the fix is applied.

  • Niranjan Paranjape
  • Niranjan Paranjape

    Niranjan Paranjape February 18th, 2011 @ 03:23 PM

    • Title changed from “Parsing an xml file with multiple records and extra attributes (besides type) fails” to “[PATCH] Parsing an xml file with multiple records and extra attributes (besides type) fails”

    This issue still persists in current rails head. And as the old patch is no more applicable, I am resubmitting the patch for latest code.

  • Ryan Heneise

    Ryan Heneise February 23rd, 2011 @ 04:16 PM

    • Tag cleared.

    FWIW, pox_paginate extends will_paginate using attributes on the top-level xml node: https://github.com/c42/pox_paginate

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