All,

On 7/26/2011 5:23 PM, Christopher Schultz wrote:
> As I get further into the testing of Velocity Tools 2.0, I'm finding
> that the addAllParameters method isn't working as it used to.

Something very subtle is happening, here. The following all work as I
expect them to:

<p>
\$link.setRelative('/params').addQueryData('foo',
'bar').addIgnore('ignore').addAllParameters() =
$link.setRelative('/params').addQueryData('foo',
'bar').addIgnore('ignore').addAllParameters()
</p>

<p>
\$link.setRelative('/params').addIgnore('ignore').addAllParameters() =
$link.setRelative('/params').addIgnore('ignore').addAllParameters()
</p>

<p>
\$link.setRelative('/params').addQueryData('foo',
'bar').addAllParameters() =
$link.setRelative('/params').addQueryData('foo', 'bar').addAllParameters()
</p>

Given the request parameters ignore=ignored and somethingElse=else, I
get this output:

<p>
$link.setRelative('/params').addQueryData('foo',
'bar').addIgnore('ignore').addAllParameters() =
/test/params?foo=bar&amp;somethingElse=else

</p>

<p>
$link.setRelative('/params').addIgnore('ignore').addAllParameters() =
/test/params?somethingElse=else
</p>

<p>
$link.setRelative('/params').addQueryData('foo',
'bar').addAllParameters() =
/test/params?foo=bar&amp;somethingElse=else&amp;ignore=ignored
</p>

In these cases where I can see things not working, the original link
tool is being used multiple times in a loop, creating several copies
that might possibly interfere with each other (though of course they
aren't supposed to).

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to