Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#5576 closed defect (fixed) can't set method to "POST"

Reported by: guest Owned by: James Burke
Priority: high Milestone: 1.1
Component: General Version: 1.0
Keywords: iframe transport Cc:
Blocked By: Blocking:

Description fails to set the method to POST, thus it can't upload files with the "file" input type. The "GET" method type was verified by looking at the Apache server logs, despite setting the method to "POST" in both the send() function and the form itself.

With some console.log'ging I've been able to track it down to several fn.getAttributeNode() calls around line 269 in iframe.js -- javascript doesn't go beyond these for some reason. Firebug also reports an error: "TypeError?: fn.getAttributeNode is not a function message=fn.getAttributeNode is not a function"

Used dojo 1.0.2 and FF on Mac 10.4.11.

PS, who does one contact to get a real trac account?

Attachments (2)

file_upload.html (1.5 KB) - added by guest 14 years ago.
test case
diff (571 bytes) - added by Rawld Gill 14 years ago.
diff with fix

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by guest

Attachment: file_upload.html added

test case

comment:1 Changed 14 years ago by James Burke

Resolution: invalid
Status: newclosed

If I pass a DOM node for the "form" attribute, then the test case works for me:

form: dojo.byId("test_form")

comment:2 Changed 14 years ago by Rawld Gill

Resolution: invalid
Status: closedreopened

At a minimum, this is a doc error since says "All the properties described in the dojo.ioArgs type, apply to this type" and dojo.ioArgs.form is normalized by dojo.byId (line 363 of xhr.js r12291). (Note, there are other problems with the docs since they imply that dojo.ioArgs is a subset of dojo.xhrArgs which it is not: dojo.ioArgs is synthesized from dojo.xhrArgs

It seems that there is no justification for causing to behave differently than dojo.xhr.ioArgs.form. Also, normalizing a node argument with dojo.byId is pervasive in the toolkit.

Proposed repair attached.

comment:3 Changed 14 years ago by Rawld Gill

Note: all the underlining in my last post is some kind of trac problem (probably consequent to two consecutive underscore suffix on "ioArgs").

Changed 14 years ago by Rawld Gill

Attachment: diff added

diff with fix

comment:4 Changed 14 years ago by James Burke

Milestone: 1.2
Owner: changed from anonymous to James Burke
Status: reopenednew

comment:5 Changed 14 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [12661]) Fixes #5576: allow args.form for calls to be a string that uses dojo.byId to find the node. Thanks rcgill for pointing out the API inconsistency.

comment:6 Changed 14 years ago by James Burke

Milestone: 1.21.1
Note: See TracTickets for help on using tickets.