Right. We're deserializing (parsing) the query string into an object
model and then reserializing it.
It's a known issue that we can't always serialize/deserialize objects
consistently with the current model. So in some cases the end result
won't be what you might expect.
I'd like to make this model more consistent but it's difficult to do
that and still be conveniently compatible with many different server-
side tools.
However, this particular case of empty keys can probably be resolved
so I'd encourage you to open a ticket for it in Lighthouse.
This sort of looks like a PHP-style URL. May I suggest using an index
in the query as a quick solution?
new URI('http://test.com/?f[28][0]=110&order=pv');
On Mar 16, 6:01 pm, Aaron Newton <[email protected]> wrote:
> Can you open a ticket in lighthouse (I'd do it for you, but then you won't
> get any email replies).
>
> I can tell you that the issue is actually in String.QueryString.js.
>
> This line:
>
> keys = index < 0 ? [''] : val.substr(0, index).match(/[^\]\[]+/g),
>
> turns something like this:
>
> foo[bar][baz]=1
>
> into this:
>
> {
> foo: {
> bar: {
> baz: 1
> }
> }
>
> }
>
> But it doesn't know what to do with an empty array (at the moment). Open a
> ticket (and maybe paste this bit of info into it). Open the ticket in the
> -more lighthouse:
>
> http://mootools.lighthouseapp.com/projects/24057-mootoolsmore
>
>
>
> On Tue, Mar 16, 2010 at 9:05 AM, baikis <[email protected]> wrote:
> > I have the code:
>
> > var uri = new URI('http://test.com/?f[28][]=110&order=pv');
> > console.log(uri.toString());
> > uri.setData('order', 'bv');
> > console.log(uri.toString());
>
> > result is: "http://test.com/?f[28]=110&order=bv"
>
> > it is missing "[]" after "f[28]"
>
> > MooShell:
>
> >http://mootools.net/shell/78Nfa/6/