diff --git a/core/modules/file/migration_templates/d7_file_private.yml b/core/modules/file/migration_templates/d7_file_private.yml index 290f367..9c6b8e2 100644 --- a/core/modules/file/migration_templates/d7_file_private.yml +++ b/core/modules/file/migration_templates/d7_file_private.yml @@ -29,9 +29,6 @@ process: - '@source_full_path' - uri filemime: filemime - # filesize is dynamically computed when file entities are saved, so there is - # no point in migrating it. - # filesize: filesize status: status # Drupal 7 didn't keep track of the file's creation or update time -- all it # had was the vague "timestamp" column. So we'll use it for both. diff --git a/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php index bb5f17c..7b6f763 100644 --- a/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php +++ b/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php @@ -8,12 +8,15 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase; /** - * Migrates all files in the file_managed table. + * Tests private files migration. * * @group file */ class MigratePrivateFileTest extends MigrateDrupal7TestBase { + /** + * {@inheritdoc} + */ public static $modules = ['file']; /** @@ -72,10 +75,10 @@ public function register(ContainerBuilder $container) { protected function assertEntity($id, $name, $uri, $mime, $size, $created, $changed, $uid) { /** @var \Drupal\file\FileInterface $file */ $file = File::load($id); - $this->assertTrue($file instanceof FileInterface); + $this->assertInstanceOf(FileInterface::class, $file); $this->assertSame($name, $file->getFilename()); $this->assertSame($uri, $file->getFileUri()); - $this->assertTrue(file_exists($uri)); + $this->assertFileExists($uri); $this->assertSame($mime, $file->getMimeType()); $this->assertSame($size, $file->getSize()); // isPermanent(), isTemporary(), etc. are determined by the status column. diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 5c73d66..c87247e 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -956,9 +956,6 @@ public function buildCredentialForm(array $form, FormStateInterface $form_state) '#title' => $this->t('Files directory'), '#description' => $this->t('To import files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot), or your site address (for example http://example.com).'), '#states' => [ - 'invisible' => [ - ':input[name="version"]' => ['value' => 7], - ], 'visible' => [ ':input[name="version"]' => ['value' => 6], ], @@ -970,9 +967,6 @@ public function buildCredentialForm(array $form, FormStateInterface $form_state) '#title' => $this->t('Public files directory'), '#description' => $this->t('To import public files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot), or your site address (for example http://example.com).'), '#states' => [ - 'invisible' => [ - ':input[name="version"]' => ['value' => 6], - ], 'visible' => [ ':input[name="version"]' => ['value' => 7], ], @@ -985,9 +979,6 @@ public function buildCredentialForm(array $form, FormStateInterface $form_state) '#default_value' => '', '#description' => $this->t('To import private files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot).'), '#states' => [ - 'invisible' => [ - ':input[name="version"]' => ['value' => 6], - ], 'visible' => [ ':input[name="version"]' => ['value' => 7], ],