Problem/Motivation
The file validation process has evolved in Drupal 10.2, with this change record: https://www.drupal.org/node/3363700
hook_file_validateis deprecated and replaced with a\Drupal\file\Validation\FileValidationEventthat is dispatched by\Drupal\file\Validation\FileValidator::validate().
Proposed resolution
Implement an EventSubscriber to add the custom validation code that can add to the ConstraintViolationList.
Remaining tasks
Implement the new API.
User interface changes
TBC.
API changes
Breaking change?
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | clamav.tgz | 3.54 KB | manarth |
| #4 | antivirus.tgz | 2.87 KB | manarth |
Comments
Comment #2
dpiJust want to jump in and let you know this is in progress for 3.x already, I'll be pushing code in the near future.
Comment #3
dpiAs visible at https://git.drupalcode.org/project/clamav/-/merge_requests/11/diffs#54a6...
Closing and rolling into #3423633: Code modernisation
Comment #4
manarth commentedSounds like we should have a convo – I've also got work in progress, which perhaps includes a further level of abstraction and also explores a better implementation of seperation of concerns.
I'm attaching zips of the two relevant modules, but this is literally a day and a half on the new concept, so much left to consider.
Comment #5
manarth commentedComment #6
dpiPlease post a MR for consideration.
An archive is not something I'm going to review.
I'll take a look at a future MR, if you can do the same for the link I posted.
Comment #7
manarth commentedI've been given maintainership for the Antivirus module, so we have a feasible route for developing in that direction.
The latest WIP is updated in GitHub:
- https://github.com/manarth/antivirus/
- https://github.com/manarth/clamav/
There's a lot of overlap in the principles used in the MR https://git.drupalcode.org/project/clamav/-/merge_requests/11/diffs#54a6... and the above, with some minor variations (use of plugins rather than container-tag definitions, to facilitate using plugin-forms for configuration).
Comment #8
manarth commentedI've published branch 2.x of the Antivirus module and branch 4.x of ClamAv, which together should provide a D-11 compatible implementation.
It's refactored to use constraints, allow multiple scanners, and offer a more robust future-proof approach.
Comment #9
vladimirausComment #10
jannakha commented