Skip to content
Snippets Groups Projects
Commit d0a486d5 authored by Lucas Hedding's avatar Lucas Hedding
Browse files

Issue #3125467: Drupal 9 readiness

parent d07bee71
Branches
Tags 8.x-1.0-rc1
No related merge requests found
......@@ -10,5 +10,9 @@
"issues": "https://www.drupal.org/project/issues/migrate_source_ui",
"source": "http://cgit.drupalcode.org/migrate_source_ui"
},
"require": { }
"require": { },
"suggest": {
"drupal/migrate_plus": "Provides JSON and XML sources",
"drupal/migrate_source_csv": "Provides CSV source"
}
}
......@@ -2,10 +2,9 @@ name: Migrate Source UI
type: module
description: UI for CSV, XML or JSON sources.
core: 8.x
core_version_requirement: ^8 || ^9
package: Migrate
configure: migrate_source_ui.form
dependencies:
- drupal:migrate
- drupal:migrate_plus
- drupal:migrate_source_csv
......@@ -2,6 +2,7 @@
namespace Drupal\migrate_source_ui\Form;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\migrate\Plugin\Migration;
......@@ -71,7 +72,7 @@ class MigrateSourceUiForm extends FormBase {
if ($migrationInstance->getSourcePlugin() instanceof CSV || $migrationInstance->getSourcePlugin() instanceof Json || $migrationInstance->getSourcePlugin() instanceof Xml) {
$id = $definition['id'];
$options[$id] = $this->t('%id (supports %file_type)', [
'%id' => isset($definition['label']) ? $definition['label'] : $id,
'%id' => $definition['label'] ?? $id,
'%file_type' => $this->getFileExtensionSupported($migrationInstance),
]);
}
......@@ -109,7 +110,7 @@ class MigrateSourceUiForm extends FormBase {
$extension = $this->getFileExtensionSupported($migrationInstance);
$validators = ['file_validate_extensions' => [$extension]];
$file = file_save_upload('source_file', $validators, FALSE, 0, FILE_EXISTS_REPLACE);
$file = file_save_upload('source_file', $validators, FALSE, 0, FileSystemInterface::EXISTS_REPLACE);
if (isset($file)) {
// File upload was attempted.
......@@ -136,9 +137,9 @@ class MigrateSourceUiForm extends FormBase {
// Reset status.
$status = $migration->getStatus();
if ($status != MigrationInterface::STATUS_IDLE) {
if ($status !== MigrationInterface::STATUS_IDLE) {
$migration->setStatus(MigrationInterface::STATUS_IDLE);
drupal_set_message($this->t('Migration @id reset to Idle', ['@id' => $migration_id]), 'warning');
$this->messenger()->addWarning($this->t('Migration @id reset to Idle', ['@id' => $migration_id]));
}
$options = [
......
......@@ -12,6 +12,11 @@ use Drupal\Tests\BrowserTestBase;
*/
class LoadTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Modules to enable.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment