Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Handle validating failed file uploads #15166

Merged
merged 1 commit into from
Sep 2, 2016
Merged

[5.3] Handle validating failed file uploads #15166

merged 1 commit into from
Sep 2, 2016

Conversation

themsaid
Copy link
Member

This PR is an attempt to deal with these issues: #8203, #4467, #4226 and many other duplicates.

The problem:
When uploading files greater than upload_max_filesize all validation rules related to file validation fails due to the file being invalid. Also a required validation rule will return false so the user will get "The file is required" even though he did attach a file to the form.

The suggested solution:
While validating each rule we check if the value is a file that failed to upload isValid()===false and that a rule that imply the field is required or is a file was being used. If that's the case we cause the validation to fail with a message file_uploaded, this message will have a translation line in the language files and the output will be The image uploading failed..

This behaviour will indicate a generic upload failure instead of showing a validation error that's not related to the actual problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants