-
Notifications
You must be signed in to change notification settings - Fork 78
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
PHP file upload error from backend shows success #428
Comments
For a little more detail on step 2 from above:
I ended up doing the following to reliably reproduce the error:
|
this seems like a lot of loops to trigger an error that ive never seen come up? The problems plugin will also error when /tmp isnt writeable and its a default plugin that comes with grav |
I had an issue with PHP generating file upload errors in production, in that case it was large file uploads and PHP failing to write to disk. After investigating I saw that the Form class was using The reproduction steps above are simply the best I could come up with to reliably reproduce the error in a dev environment. Any set of circumstances which causes PHP to generate one of the file upload errors (https://www.php.net/manual/en/features.file-upload.errors.php) will trigger the same behaviour. |
If there is a PHP file upload error when handling a file upload (eg. https://www.php.net/manual/en/features.file-upload.errors.php) the frontend still shows success.
Reproduction steps:
upload_tmp_dir
directory to cause a permission error.task:file-upload
was{"status":"error","message":"Unable to upload file filename.txt: "}
.I took a look at the code in the
handleError
function inapp/fields/file.js
line 206 and it simple returns true. This code should probably display a failure and show the error message returned from the backend.Also, the error message returned from the backend doesn't look to be complete. I will submit a pull request to fix this in a bit.
The text was updated successfully, but these errors were encountered: