Problem/Motivation

The file validation process has evolved in Drupal 10.2, with this change record: https://www.drupal.org/node/3363700

hook_file_validate is deprecated and replaced with a \Drupal\file\Validation\FileValidationEvent that 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.

CommentFileSizeAuthor
#4 clamav.tgz3.54 KBmanarth
#4 antivirus.tgz2.87 KBmanarth

Comments

manarth created an issue. See original summary.

dpi’s picture

Assigned: manarth » dpi

Just 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.

dpi’s picture

Assigned: dpi » Unassigned
Status: Active » Closed (outdated)
Related issues: +#3423633: Code modernisation
manarth’s picture

StatusFileSize
new2.87 KB
new3.54 KB

Sounds 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.

manarth’s picture

Status: Closed (outdated) » Needs work
dpi’s picture

Status: Needs work » Postponed (maintainer needs more info)

Please 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.

manarth’s picture

I'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).

manarth’s picture

Status: Postponed (maintainer needs more info) » Needs review

I'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.

vladimiraus’s picture

Version: 2.x-dev » 2.1.x-dev
Status: Needs review » Fixed
  • Moving standalone D11 support to 2.1.x branch
  • 4.0.x release was created for Antivirus support
jannakha’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.