Skip to content
Snippets Groups Projects

Use the array of validators in the correct format depending on the version of Drupal

Files
2
@@ -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.
Loading