Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Loosing field contents when positioned after file upload

#2161

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.

Reported by Keith Pitt · March 7th, 2009 @ 01:49 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • 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.

    August 5th, 2009 @ 03:01 PM

  2. Elise Huard
    Elise Huard

    -1, tested this and it's not a problem on master

    August 9th, 2009 @ 12:42 PM

  3. Rizwan Reza
    Rizwan Reza

    not reproducible

    -1 This also not present in 2-3-stable. Safe to tag as invalid.

    August 9th, 2009 @ 03:39 PM

  4. Simon Jefford
    Simon Jefford

    -1 also verified as not present in 2-3-stable

    August 9th, 2009 @ 04:42 PM

  5. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to resolved
    • Tag changed from bug, bugmash, file, upload to bug, file, upload

    August 9th, 2009 @ 04:45 PM

  6. Dan Croak
    Dan Croak
    • Tag changed from bug, file, upload to bug, bugmash, file, upload

    -1 not reproducible

    August 9th, 2009 @ 04:47 PM

  7. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from bug, bugmash, file, upload to bug, file, upload
    • Milestone cleared.

    August 9th, 2009 @ 05:13 PM