File validation changed in Drupal 10.2
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3480275. --> Reported by: [benjifisher](https://www.drupal.org/user/683300) Related to !8 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Using this module with Drupal 11, I get a WSOD with the following error when I submit the form at <code>/admin/content/migrate_source_ui</code>:</p> <blockquote><p> Drupal\Component\Plugin\Exception\PluginNotFoundException: The "file_validate_extensions" plugin does not exist. Valid plugin IDs for Drupal\Core\Validation\ConstraintManager are: ... </p></blockquote> <p>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.</p> <p>See this change record: <a href="https://www.drupal.org/node/3363700">file_validate and related functions are deprecated and replaced with file.validator service and Constraint plugins</a>.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Install Drupal 11, <a href="https://www.drupal.org/project/migrate_source_csv">Migrate Source CSV</a>, and this module.</li> <li>Create a migration to import CSV files.</li> <li>Upload the file at <code>/admin/content/migrate_source_ui</code>.</li> <li>Select the CSV migration.</li> <li>Submit the form.</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>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.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p>None</p> <h3 id="summary-api-changes">API changes</h3> <p>None</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None</p>
issue