- Issue created by @KlemenDEV
- ๐ณ๐ฟNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies โ
- ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
The event is for altering validation constraints. If you are creating a new one, you probably want to implement your own
ConstraintValidator
plug-in that extends\Drupal\file\Plugin\Validation\Constraint\BaseFileConstraintValidator
. - Status changed to Needs work
8 days ago 2:29pm 1 May 2025 - ๐ธ๐ฎSlovenia KlemenDEV
Looking at this change record - https://www.drupal.org/node/3363700 โ - it recommends replacing hook_file_validate with FileValidationEvent. Is the change record wrong in this case? Because, as explained at https://www.drupal.org/project/clamav/issues/3503176#comment-15967597 ๐ File upload stopped working after updating to 2.1.0 Active , the module adapted the recommended event replacement
- ๐ธ๐ฎSlovenia KlemenDEV
Also, shouldn't this event still provide the correct file size when uploading, as if you check my post, the uploaded file data is not correct when using FileValidationEvent?
- ๐ธ๐ฎSlovenia KlemenDEV
This may also be happening because the images are downsized if too big, and then two different sizes are in question - the true size and the resized one. Related: https://www.drupal.org/project/drupal/issues/3292350#comment-16093652 ๐ file_validate_image_resolution does not update file size after resizing Needs work