Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
lighthouse-import opened this Issue · 7 comments

1 participant

@lighthouse-import

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/3217
Created by Sidu Ponnappa - 2011-02-19 09:28:11 UTC

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.

@lighthouse-import

Imported from Lighthouse.
Comment by Dmitry Polushkin - 2010-02-26 15:51:56 UTC

+1

@lighthouse-import

Imported from Lighthouse.
Comment by Niranjan Paranjape - 2010-09-23 15:25:39 UTC

This problem persists in Rails 3.0.0

@lighthouse-import

Imported from Lighthouse.
Comment by Jeff Kreeftmeijer - 2010-10-10 19:11:22 UTC

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

@lighthouse-import

Imported from Lighthouse.
Comment by Rohit Arondekar - 2010-10-14 13:08:05 UTC

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.

@lighthouse-import

Imported from Lighthouse.
Comment by Niranjan Paranjape - 2011-02-18 15:23:24 UTC

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.

@lighthouse-import

Imported from Lighthouse.
Comment by Ryan Heneise - 2011-02-23 16:16:19 UTC

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

@kaiwren kaiwren referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@kaiwren kaiwren referenced this issue from a commit in c42engineering/rails
@kaiwren kaiwren Issue #636 - Parsing an xml file with multiple records and extra attr…
…ibutes (besides type) fails
83555a5
@bratish bratish referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@sikachu sikachu referenced this issue from a commit in sikachu/rails
@kaiwren kaiwren Issue #636 - Parsing an xml file with multiple records and extra attr…
…ibutes (besides type) fails
981f076
@ttosch ttosch referenced this issue from a commit
@kaiwren kaiwren Issue #636 - Parsing an xml file with multiple records and extra attr…
…ibutes (besides type) fails
8d54d35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.