To reproduce:

I have a clean, (Hungarian localized) drupal 7.0 install with no modules enabled apart from those that come with the Standard install.

1. I create a node type Twofiles, delete the field body and add two identical File fields named 'fajl' and 'fajl2', both having the display field enabled by default, upload extensions set to "txt pdf odt doc", description field enabled and Number set to unlimited.

2. I add node type Twofiles
3. I upload to field 'fajl' 1.pdf file. ok
4. I upload to field 'fajl2' 2.pdf file. ok
5. When I try to add 3.pdf file to field 'fajl' that's what happens:
- 3.pdf does not appear in the list
- I get an error message that the Title field needs to be filled in (as if I had submitted the node)
- The upload part of field 'fajl' disappears
See screenshot attachment. (In Hungarian, but I think you will be able to see my point.)

This might be a field_ui issue, I don't know. Strangely enough I have not found anybody reporting this.

Comments

BarisW’s picture

Could it be that your file upload size is limited to 1MB per node?

czigor’s picture

No, it is 128MB and it would behave in another way.

EDIT: I was wrong, 128 MB is my php upload limit. I did not set any per node upload limit. But it is behaving like this even if the uploaded files add up to only 0.5 MB.

Can anyone reproduce this error?

idflood’s picture

Version: 7.0 » 8.x-dev

I reproduced this on a clean 8.x install. I simply added two file fields to the page content type ( unlimited ). Then I reproduced the error exactly like described ( I should note that after the error appears the first file field will have his "Add a new file" section removed ).

I then tried to disable javascript and the error is not exactly the same.
1. upload a file in field1
2. upload a file in field2
3. The "Add a new file" is removed from the field1 but there are no errors shown

The issue is maybe coming from file/file.field.inc--file_field_widget_form(). That's a guess, but this is the function responsible for creating the form at least.

idflood’s picture

StatusFileSize
new2.77 KB

Here is a patch that only add some test in file module to prove this issue. But the behavior from the test is a little bit different than manual testing. Here is what is going on with the test if I'm correct:
- add two file fields to the "page" content type
- create a new page
- upload a file to field1
- The page is reloaded and there is already no "Add a new file" in the first field. ( still present if tested manually )
- can't upload a second file to field1 ( works if tested manually )
- upload a file to field2
- upload a second file to field2
- still can't upload any file to field1 so uploading a "third" file in there fails ( works if tested manually )
- test pass the assertNoText('Title field is required') ( this error is shown if tested manually )
- the test fail on the two last test as expected since this is already wrong after trying to upload the second file to the field1

Maybe I did something wrong with the test as this is not how it fails when doing the test manually.

idflood’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, multi_file_field-1112966-4.patch, failed testing.

sun’s picture

Issue tags: +Needs backport to D7

Did anyone check for duplicate issues? If not, please do.

catch’s picture

Status: Needs work » Closed (duplicate)