This project is archived and is in readonly mode.
Loosing field contents when positioned after file upload
Reported by Keith Pitt | March 7th, 2009 @ 01:49 AM
I have a form that contains a file upload and a 2 text fields.
<li><%= t.file_field :artwork %></li>
<li><%= t.text_field :caption %></li>
<li><%= t.text_field :tags %></li>
When I submit the form with a file upload, and filling in the 2 other fields, the "caption" field drops from the posted fields.
Processing Admin::Campaigns::AdvertisementsController#create (for 127.0.0.1 at 2009-03-07 12:14:14) [POST]
Parameters: {"campaign_advertisement"=>{"artwork"=>#<File:/var/folders/PD/PDwtDVH6G1qCmfQOwD-Og++++TI/-Tmp-/RackMultipart.15675.0>}, "tags" => "foo bar", "commit"=>"post", "campaign_id"=>"1", "authenticity_token"=>"Y0gwv6Ev9DdH4mgLAN86y+W+rMQOR2GsMoSqHKCdqoE="}
But if I submit the form without the file upload, the "caption" field comes through.
Processing Admin::Campaigns::AdvertisementsController#create (for 127.0.0.1 at 2009-03-07 12:17:37) [POST]
Parameters: {"campaign_advertisement"=>{"artwork"=>nil, "caption"=>"asdfasdfasdf", "tags" => "foo bar"}, "commit"=>"post", "campaign_id"=>"1", "authenticity_token"=>"Y0gwv6Ev9DdH4mgLAN86y+W+rMQOR2GsMoSqHKCdqoE="}
I have no tricky javascript going on that would cause something like this. I'm running rails 2.3.0 rc1. I have tried rc2 but couldn't even get that working. (params wherent working, i.e. name="member[userame]" wasnt being turned into { :members =>{ :username => 'foo' }}.
I also noticed that If I switch the position of "tags" and "caption" around, so it reads:
<li><%= t.file_field :artwork %></li>
<li><%= t.text_field :tags %></li>
<li><%= t.text_field :caption %></li>
"tags" is now dropped from the posted fields. It would seem any field directly after the file upload is being dropped from post.
Comments and changes to this ticket
-
CancelProfileIsBroken August 5th, 2009 @ 03:01 PM
- Tag changed from bug, file, upload to bug, bugmash, file, upload
I think this is a duplicate - we've had several file_field issues resolved recently - but I can't find an exact match right at the moment.
-
Rizwan Reza August 9th, 2009 @ 03:39 PM
not reproducible
-1 This also not present in 2-3-stable. Safe to tag as invalid.
-
CancelProfileIsBroken August 9th, 2009 @ 04:45 PM
- State changed from new to resolved
- Tag changed from bug, bugmash, file, upload to bug, file, upload
-
Dan Croak August 9th, 2009 @ 04:47 PM
- Tag changed from bug, file, upload to bug, bugmash, file, upload
-1 not reproducible
-
CancelProfileIsBroken August 9th, 2009 @ 05:13 PM
- Tag changed from bug, bugmash, file, upload to bug, file, upload
- Milestone cleared.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>