Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10118 (closed defect: fixed)

Opened 6 months ago

Last modified 5 days ago

[PATCH] [TEST] Protoype Form.serialize should not serialize file inputs

Reported by: Lonesome Boy Assigned to: kangax
Priority: normal Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords:
Cc:

Description

Prototype 1.6

Form.serialize tries to serialize file inputs although it shouldn't.

You can reproduce the bug by making a form whith a input of type "file" and serializing it with the Form.serialize() funtion.

I changed the line 3356 (serializeElements function) and added the condition " && element.type != 'file'" in order to prevent Prototype from serializing files (since I use Struts, I get an error if I try to send a value for a file object).

Sorry if I missed nothing and I'm wrong.

Attachments

0004-Do-not-serialize-input-elements-with-file-type.-Clos.patch (1.8 kB) - added by kangax on 03/31/08 12:21:26.

Change History

(in reply to: ↑ description ) 11/30/07 20:51:31 changed by Lonesome Boy

  • priority changed from normal to high.

Replying to Lonesome Boy:

Prototype 1.6 Form.serialize tries to serialize file inputs although it shouldn't. You can reproduce the bug by making a form whith a input of type "file" and serializing it with the Form.serialize() funtion. I changed the line 3356 (serializeElements function) and added the condition " && element.type != 'file'" in order to prevent Prototype from serializing files (since I use Struts, I get an error if I try to send a value for a file object). Sorry if I missed nothing and I'm wrong.

WIll this bug be fixed soon (fixing it takes less than one minute)? Is it really a bug?

01/23/08 20:36:26 changed by kangax

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

As per W3C specs

"The current value of a file select is a list of one or more file names. Upon submission of the form, the contents of each file are submitted with the rest of the form data. The file contents are packaged according to the form's content type."

03/31/08 12:21:26 changed by kangax

  • attachment 0004-Do-not-serialize-input-elements-with-file-type.-Clos.patch added.

03/31/08 12:22:00 changed by kangax

  • summary changed from Protoype Form.serialize tries to serialize file inputs although it shouldn't to [PATCH] [TEST] Protoype Form.serialize should not serialize file inputs.

03/31/08 12:22:43 changed by kangax

  • owner changed from sam to kangax.

05/07/08 19:12:55 changed by jdalton

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