Ticket #5793 (closed defect: fixed)

Opened 10 months ago

Last modified 9 months ago

[patch][need cla] dojo.formToObject doesn't skip form fields having no name...

Reported by: guest Owned by: alex
Priority: normal Milestone: 1.1
Component: Core Version: 1.0
Severity: normal Keywords: dojo.formToObject dojo.formToQuery dojo.formToJson unnamed fields
Cc: vikas.sasidharan@…

Description

If you do dojo.formToObject() on a form, it doesn't ignore form fields that don't possess any name (such as those typically used by Dojo Widgets behind the scenes). Because of this, the generated query contains a lot of useless parameters of the form "?=val1&=val2..." etc.

I believe this bug is occurring because the filtering logic only checks for disabled items.

Suggested fix: Change line no. 60 in xhr.js :

Is:

return (!node.disabled);

Should Be:

return (!node.disabled && node.name);

Attachments

test.html (2.9 kB) - added by guest 9 months ago.
Added CLA... No other change.

Change History

Changed 9 months ago by dylan

  • owner changed from anonymous to alex
  • summary changed from dojo.formToObject doesn't skip form fields having no name... to [patch][need cla] dojo.formToObject doesn't skip form fields having no name...
  • milestone set to 1.1

Can we please get a CLA for the testcase?

Changed 9 months ago by peller

(In [12669]) Incorporating fix, but can't take test case w/o cla. Refs #5793

Changed 9 months ago by peller

  • priority changed from high to normal
  • severity changed from major to normal

Changed 9 months ago by peller

  • status changed from new to closed
  • resolution set to fixed

can't check in the test case without a cla. please reopen if you can get us a cla. thanks

Changed 9 months ago by guest

Added CLA... No other change.

Note: See TracTickets for help on using tickets.