Here are the steps:
- In a multi-value image field of a content type, add 3 images that are below the "Maximum upload size". Let say that Maximum is 3MB and the uploaded files are 2.5MB
- Save the node
- In the image field settings, change the "Maximum upload size" to 2MB
- Edit the node and try to remove images
It is not possible to remove the images (by clicking the "remove" button) because, when doing this, the field are highlighted in red due to a validation error regarding their size
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | file_browser-remove-errors-2731957-7.0.patch | 1.22 KB | samuel.mortenson |
Comments
Comment #2
samuel.mortensonI copied FileWidget's handling of this exact problem - do you mind trying it out for me @DuneBL?
Comment #4
samuel.mortensonComment #5
duneblSorry for my late answer.
I have tested with a simple value field:
1-upload a 1.8 MB file
2-Change field property: Max=1Mb
3-Edit the node to try to remove the file
Result=the "description" subfield of the file field is red (without message)
widget=Browser for file (modal)
If I change the file field definition by removing the "Activate description field" and after that if I try to remove the file, I don't have any message, and no red square, but nothing happens: the file is not removed
As a side node, firstly I didn't apply the patch because I saw it was committed; but in fact, it was not the case.
I use "composer require" to install all my module.
But after a "composer update" file_browser didn't get updated and the patch was not included.
Here is my extract of composer.lock
Comment #6
samuel.mortenson@DuneBL You're right, sorry for committing early. I was trying to get some other changes in and based on my testing (which missed the bug), this was working. Could you try this new patch and let me know if it works out for you?
Comment #7
samuel.mortensonThe last patch will break translation, this one should work with any button #value.
Comment #8
samuel.mortensonComment #9
duneblIn confirm that #7 is doing the job!!
Thanks for this
Comment #11
samuel.mortensonNice! Thanks for the review.