See following change record: https://www.drupal.org/node/3363700

To reproduce:
- add a file field with filesize validation on Drupal 11.
- Try to upload a field: you'll get following error: The "file_validate_size" plugin does not exist ..." in the logs

patch upcoming

CommentFileSizeAuthor
#6 3510733-6.patch832 bytesswentel
#2 3510733-2.patch841 bytesswentel
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

swentel created an issue. See original summary.

swentel’s picture

Category: Task » Bug report
Priority: Normal » Major
StatusFileSize
new841 bytes
swentel’s picture

Title: Validators are changed » File validators have changed

better title

swentel’s picture

Status: Active » Needs review
keshav patel’s picture

Status: Needs review » Needs work

@swentel
Please check that "file_validate_extensions" is mistakenly substituted by "FileImageDimensions", it should be changed to "FileExtension".

swentel’s picture

Status: Needs work » Needs review
StatusFileSize
new832 bytes

Ah crap, that was stupid sorry :) New patch.

apmsooner’s picture

We will probably need to create a 4.x new branch with core dependency ^10.3 || 11 to handle this as I believe these changes to file logic were introduced in 10.3 and therefore not compatible with 10.2. I'd say let me do that first and then can reassign this issue to that branch.

swentel’s picture

10.2.x is EOL, so just up the constraint of the module to 10.3 - that's good enough imo. A new branch seems way overkill for that.

swentel’s picture

Also, those validations area introduced in 10.2.0, so it's fine no?

apmsooner’s picture

PHP stan says they were introduced in 10.3? https://git.drupalcode.org/project/custom_field/-/jobs/4499168

swentel’s picture

Hmm, change record says 10.2.0, and in 10.4.x branch of DC too: https://git.drupalcode.org/project/drupal/-/blob/10.4.x/core/modules/fil...

apmsooner’s picture

Okay let me test this. If you can please push the change to the issue fork, i can test easier also.

swentel’s picture

Pushed! (sorry, needed patches file for composer.patches for a couple of projects quickly, so did that first :)

apmsooner’s picture

Status: Needs review » Fixed

  • apmsooner committed 46ade135 on 3.1.x authored by swentel
    Issue #3510733 by swentel, keshav patel: File validators have changed
    
apmsooner’s picture

Thanks for the patch on this. I verified it was indeed introduced in 10.2. In 10.3 there is a trait introduced that we can use to further simplify but will cross that bridge later ;)

apmsooner’s picture

Status: Fixed » Closed (fixed)