File validation changed in Drupal 10.2

Created on 12 October 2024, 3 months ago

Problem/Motivation

Using this module with Drupal 11, I get a WSOD with the following error when I submit the form at /admin/content/migrate_source_ui:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "file_validate_extensions" plugin does not exist. Valid plugin IDs for Drupal\Core\Validation\ConstraintManager are: ...

That makes this module unusable with Drupal 11, which is why I am setting the priority to Critical. I have not tested with Drupal 10.2 or 10.3, but I assume that would lead to deprecation messages.

See this change record: file_validate and related functions are deprecated and replaced with file.validator service and Constraint plugins β†’ .

Steps to reproduce

  1. Install Drupal 11, Migrate Source CSV β†’ , and this module.
  2. Create a migration to import CSV files.
  3. Upload the file at /admin/content/migrate_source_ui.
  4. Select the CSV migration.
  5. Submit the form.

Proposed resolution

In the form class, check the version of Drupal. If it is at least 10.2.0, then use the new file-upload validation method.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024