Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
Event listener parameters of type 'array' or 'object' not encoded correctly and therefore interpreted as strings on the server side.
For example, say we have the following ExtJS JavaScript:
this.fireEvent('foo', [ 'one', 'two' ]);
The Wicket Ajax code eventually converts the array parameter to URL encoded string using jQuery.param in (wicket-ajax-jquery.js, line 555-556):
// convert to URL encoded string
data = jQuery.param(data);
For the example this boils down to:
jQuery.param([
{name: 'foo', value: ['one','two']}]);
This results in the following encoded query parameter in the URL:
"foo=one%2Ctwo"
Since the value does not start with a '[', the server-side parsing of the value does not convert it to a JSONArray, but to the following string:
"one,two"
As a result, the server-side event listener code will get a JSONArray object with only this string in it. As long as the passed array contains only one string everything will still work correctly, but with multiple strings errors will occur.
Attachments
Issue Links
- causes
-
CMS-7663 Regression: cannot edit channel properties
- Closed
-
CMS-7612 Warnings in log during Dev Trails
- Closed
-
WICKETEXTJS-53 String event listener parameters are not encoded correctly
- Closed
- is a result of
-
CMS-7029 Upgrade CMS core to Wicket 6
- Closed