Problem/Motivation

If field settings are changed for a file field then existing files can become invalid. Example: a field has no extension limitation and an image field is uploaded. Then the admin enables file extension validation for the field so that only *.txt files are allowed. If a user now wants to remove an invalid image file with the remove button an error is shown that the file is invalid. The user is not able to save the entity or remove the file now and is stuck.

Proposed resolution

Do not validate files if the Remove button is clicked.

Remaining tasks

Patch reviews.

User interface changes

none.

API changes

none.

Data model changes

none.

Comments

klausi created an issue. See original summary.

klausi’s picture

Status: Active » Needs review
StatusFileSize
new3.13 KB

Patch.

Status: Needs review » Needs work

The last submitted patch, 2: file-always-remove-2602540-2.patch, failed testing.

effulgentsia’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB

Does this bug actually exist in HEAD, or will it only get introduced with some other patch committed? Here's the #2 patch with only the test, and it passes when I run it locally.

klausi’s picture

Status: Needs review » Closed (duplicate)

Oh, so I was getting a bit ahead of myself when testing this with #2594565: File extension + max_filesize should be validated using a Constraint on file fields. Looks like we need to merge this patch into that issue then.