Skip to content
Snippets Groups Projects
Commit d2b1543d authored by Benji Fisher's avatar Benji Fisher Committed by Lucas Hedding
Browse files

Issue #3480275 by benjifisher, heddn: File validation changed in Drupal 10.2

parent 6167e75f
Branches
Tags 8.x-1.2
1 merge request!8Use the array of validators in the correct format depending on the version of Drupal
Pipeline #379774 passed with warnings
name: Migrate Source UI
type: module
description: UI for CSV, XML or JSON sources.
core_version_requirement: ^10.1 || ^11
core_version_requirement: ^10.2 || ^11
package: Migrate
configure: migrate_source_ui.form
......
......@@ -107,8 +107,8 @@ class MigrateSourceUiForm extends FormBase {
'#type' => 'file',
'#title' => $this->t('Upload the source file'),
'#upload_validators' => [
'file_validate_extensions' => [
'json csv xml',
'FileExtension' => [
'extensions' => 'json csv xml',
],
],
];
......@@ -135,7 +135,7 @@ class MigrateSourceUiForm extends FormBase {
$migrationInstance = $this->pluginManagerMigration->createStubMigration($definition);
$extension = $this->getFileExtensionSupported($migrationInstance);
$validators = ['file_validate_extensions' => [$extension]];
$validators = ['FileExtension' => ['extensions' => $extension]];
// Check to see if a specific file temp directory is configured. If not,
// default the value to FALSE, which will instruct file_save_upload() to
// use Drupal's temporary files scheme.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment