The form has multiple plupload elements. If I add two files to one element and one file to another, all 3 files are uploaded. They all show up in the $_POST variable. Only the first shows up in the $form_state['values']['fieldnameone'] with an array of two elements (the files) containing an array of 4 elements (tmppath, tmpname, name, status).

The $_POST values have names that appear to be derived from the target URL, their name, an index of their order of upload and name of the field as shown below. So if the URL was /modulename/edit, the "edit" is the first part, followed by a dash, followed by the form element name, followed by an underscore, index, and name.

edit-fieldnameone_0_tmpname = "pla723317684273407326.pdf"
edit-fieldnameone_0_name = "test1.pdf"
edit-fieldnameone_0_status = "done"
edit-fieldnameone_1_tmpname = "pla9832472938hb3kj4h2k.pdf
edit-fieldnameone_1_name = "test2.pdf"
edit-fieldnameone_1_status = "done"
edit-fieldnameone_count ="2"

The second instance's naming in $_POST is different, which is not copied into the $form_state, is as follows.

edit-fieldnametwo--2_0_tmpname = "pla983432'lkj234jkj4h2k.pdf
edit-fieldnametwo--2_0_name = "test3.pdf"
edit-fieldnametwo--2_0_status = "done"
edit-fieldnametwo--2_count ="1"

Is this a bug? Am I missing an attribute in my form element definition such as '#name'? I have #title,
#type as plupload, #upload_validators, #upload_settings with 'runtime' => 'html5' and 'chunk_size' => '1mb',
#weight, #required => 'FALSE', and #description. Other than the above problem, it all seems to be working fine. Thank you.

Fred

Comments

fbrier created an issue. See original summary.

apaderno’s picture

Version: 7.x-1.7 » 7.x-1.x-dev
Issue tags: -, -$_POST, -missing file, -multiple instances, -multiple elements

I am removing issue tags used from one to four issues.