sargue-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-29 09:31 UTC
Bug on Prototype 1.6.0 ?
This is weird because it''s strange that something so used is a bug, but it relates to the new Hash rewrite. I''ve managed to create a test case: new Ajax.Request(''some url'',{parameters:$H({hola:''mundo''})}) Put the URL that you want. Parameters got something like: _object=%5Bobject%20Object %5D&each=function%20(iterator%2C%20context)%20%7B%0A%20% which of course is the own hash object serialized. I''ve tried to debug it with firebug and I''ve found that the problem is on line 1217 where Object.toQueryString is called. That is maped to $H(object).toQueryString() and it seems that for some strange reason $H(object) when object is a hash is not working because puts the hash inside a hash. (the _object property becomes a hash as well). Weird as I said, because $H($H(...)).toQueryString() is working! I''m sorry I can''t give more detailed info. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Replying to myselft. I first solved it, then found that the SVN has been patched. FYI, this is the bug report: http://dev.rubyonrails.org/ticket/10172 And this is the patch: http://dev.rubyonrails.org/changeset/8232 On Nov 29, 10:31 am, "sar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <sar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is weird because it''s strange that something so used is a bug, > but it relates to the new Hash rewrite. > > I''ve managed to create a test case: > > new Ajax.Request(''some url'',{parameters:$H({hola:''mundo''})}) > > Put the URL that you want. > > Parameters got something like: _object=%5Bobject%20Object > %5D&each=function%20(iterator%2C%20context)%20%7B%0A%20% > > which of course is the own hash object serialized. > > I''ve tried to debug it with firebug and I''ve found that the problem is > on line 1217 where Object.toQueryString is called. That is maped to > $H(object).toQueryString() and it seems that for some strange reason > $H(object) when object is a hash is not working because puts the hash > inside a hash. (the _object property becomes a hash as well). > > Weird as I said, because $H($H(...)).toQueryString() is working! > > I''m sorry I can''t give more detailed info.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---