diff --git a/core/modules/file/config/schema/file.destination.schema.yml b/core/modules/file/config/schema/file.destination.schema.yml new file mode 100644 index 0000000000000000000000000000000000000000..5d494f7013f2244ee3bcf8a5ffe2c3785b8b43ac --- /dev/null +++ b/core/modules/file/config/schema/file.destination.schema.yml @@ -0,0 +1,7 @@ +migrate.destination.entity:file: + type: migrate_destination + label: 'File' + mapping: + source_path_property: + type: string + label: 'Source path' diff --git a/core/modules/file/config/schema/file.schema.yml b/core/modules/file/config/schema/file.schema.yml index b9f8918f633148abc0ee366ff4d4a57d3fda1be2..0d41b90ee2998183e22ca31c5285a84fc3e69c90 100644 --- a/core/modules/file/config/schema/file.schema.yml +++ b/core/modules/file/config/schema/file.schema.yml @@ -121,3 +121,11 @@ field.formatter.settings.file_extension: extension_detect_tar: type: boolean label: 'Detect tar' + +migrate.source.d6_upload_instance: + type: migrate_source_sql + label: 'Drupal 6 upload form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' diff --git a/core/modules/migrate_drupal/migration_templates/d6_file.yml b/core/modules/file/migration_templates/d6_file.yml similarity index 100% rename from core/modules/migrate_drupal/migration_templates/d6_file.yml rename to core/modules/file/migration_templates/d6_file.yml diff --git a/core/modules/migrate_drupal/migration_templates/d6_file_settings.yml b/core/modules/file/migration_templates/d6_file_settings.yml similarity index 100% rename from core/modules/migrate_drupal/migration_templates/d6_file_settings.yml rename to core/modules/file/migration_templates/d6_file_settings.yml diff --git a/core/modules/migrate_drupal/migration_templates/d6_upload.yml b/core/modules/file/migration_templates/d6_upload.yml similarity index 99% rename from core/modules/migrate_drupal/migration_templates/d6_upload.yml rename to core/modules/file/migration_templates/d6_upload.yml index e0a3e53a68c36aa1d804c9eaaab94554794448d9..14a37710b3b1b80b4e648c95cf6394e4ca66661b 100644 --- a/core/modules/migrate_drupal/migration_templates/d6_upload.yml +++ b/core/modules/file/migration_templates/d6_upload.yml @@ -4,7 +4,6 @@ migration_tags: - Drupal 6 source: plugin: d6_upload - process: nid: nid vid: vid diff --git a/core/modules/migrate_drupal/migration_templates/d6_upload_entity_display.yml b/core/modules/file/migration_templates/d6_upload_entity_display.yml similarity index 100% rename from core/modules/migrate_drupal/migration_templates/d6_upload_entity_display.yml rename to core/modules/file/migration_templates/d6_upload_entity_display.yml diff --git a/core/modules/migrate_drupal/migration_templates/d6_upload_entity_form_display.yml b/core/modules/file/migration_templates/d6_upload_entity_form_display.yml similarity index 100% rename from core/modules/migrate_drupal/migration_templates/d6_upload_entity_form_display.yml rename to core/modules/file/migration_templates/d6_upload_entity_form_display.yml diff --git a/core/modules/migrate_drupal/migration_templates/d6_upload_field.yml b/core/modules/file/migration_templates/d6_upload_field.yml similarity index 100% rename from core/modules/migrate_drupal/migration_templates/d6_upload_field.yml rename to core/modules/file/migration_templates/d6_upload_field.yml diff --git a/core/modules/migrate_drupal/migration_templates/d6_upload_field_instance.yml b/core/modules/file/migration_templates/d6_upload_field_instance.yml similarity index 100% rename from core/modules/migrate_drupal/migration_templates/d6_upload_field_instance.yml rename to core/modules/file/migration_templates/d6_upload_field_instance.yml diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityFile.php b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php similarity index 98% rename from core/modules/migrate/src/Plugin/migrate/destination/EntityFile.php rename to core/modules/file/src/Plugin/migrate/destination/EntityFile.php index 57d69092515b607b16770d916419fb03822044d2..383b2834be7fb14a7db097eeb23d5f74f4679b5a 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityFile.php +++ b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php @@ -5,7 +5,7 @@ * Contains \Drupal\migrate\Plugin\migrate\destination\EntityFile. */ -namespace Drupal\migrate\Plugin\migrate\destination; +namespace Drupal\file\Plugin\migrate\destination; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityStorageInterface; @@ -15,6 +15,7 @@ use Drupal\migrate\Entity\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate\MigrateException; +use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FileUri.php b/core/modules/file/src/Plugin/migrate/process/d6/FileUri.php similarity index 89% rename from core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FileUri.php rename to core/modules/file/src/Plugin/migrate/process/d6/FileUri.php index 722cc9604d2f37242305e9f866d83d8987b75c53..8668e052b61a06b4a02b9fdb103f136dc39478ec 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FileUri.php +++ b/core/modules/file/src/Plugin/migrate/process/d6/FileUri.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\migrate_drupal\Plugin\migrate\process\d6\FileUri. + * Contains \Drupal\file\Plugin\migrate\process\d6\FileUri. */ -namespace Drupal\migrate_drupal\Plugin\migrate\process\d6; +namespace Drupal\file\Plugin\migrate\process\d6; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\ProcessPluginBase; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/File.php b/core/modules/file/src/Plugin/migrate/source/d6/File.php similarity index 95% rename from core/modules/migrate_drupal/src/Plugin/migrate/source/d6/File.php rename to core/modules/file/src/Plugin/migrate/source/d6/File.php index 4abbbaea8c9a4d0c2988809bd18d71c75d7697b6..ab53894f47a656f9838a9318476f719ebb65dd06 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/File.php +++ b/core/modules/file/src/Plugin/migrate/source/d6/File.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\migrate_drupal\Plugin\migrate\source\d6\File. + * Contains \Drupal\file\Plugin\migrate\source\d6\File. */ -namespace Drupal\migrate_drupal\Plugin\migrate\source\d6; +namespace Drupal\file\Plugin\migrate\source\d6; use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/Upload.php b/core/modules/file/src/Plugin/migrate/source/d6/Upload.php similarity index 92% rename from core/modules/migrate_drupal/src/Plugin/migrate/source/d6/Upload.php rename to core/modules/file/src/Plugin/migrate/source/d6/Upload.php index 37abe9e4a3aa4949a1ffa161145e6afaaeabc8df..7e1cc05e81265152c74d9852bb232ef6973a6765 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/Upload.php +++ b/core/modules/file/src/Plugin/migrate/source/d6/Upload.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\migrate_drupal\Plugin\migrate\source\d6\Upload. + * Contains \Drupal\file\Plugin\migrate\source\d6\Upload. */ -namespace Drupal\migrate_drupal\Plugin\migrate\source\d6; +namespace Drupal\file\Plugin\migrate\source\d6; use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php similarity index 93% rename from core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php rename to core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php index 3b24f5b5e1313580562bca43b12b4c8f0a3f977d..7e062062fa2b83bcc7e79365675fe0213d6b9539 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php +++ b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\migrate_drupal\Plugin\migrate\source\d6\UploadInstance. + * Contains \Drupal\file\Plugin\migrate\source\d6\UploadInstance. */ -namespace Drupal\migrate_drupal\Plugin\migrate\source\d6; +namespace Drupal\file\Plugin\migrate\source\d6; use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase; use Drupal\migrate\Plugin\migrate\source\DummyQueryTrait; diff --git a/core/modules/migrate/src/Tests/EntityFileTest.php b/core/modules/file/src/Tests/Migrate/EntityFileTest.php similarity index 97% rename from core/modules/migrate/src/Tests/EntityFileTest.php rename to core/modules/file/src/Tests/Migrate/EntityFileTest.php index 718e0a7505dda8fd9bf7a10d51167dc912db3e95..42826aa3ff36733517ed7216c7e580d77a2e69a4 100644 --- a/core/modules/migrate/src/Tests/EntityFileTest.php +++ b/core/modules/file/src/Tests/Migrate/EntityFileTest.php @@ -2,14 +2,14 @@ /** * @file - * Contains \Drupal\migrate\Tests\EntityFileTest. + * Contains \Drupal\file\Tests\Migrate\EntityFileTest. */ -namespace Drupal\migrate\Tests; +namespace Drupal\file\Tests\Migrate; use Drupal\Core\Site\Settings; use Drupal\migrate\Row; -use Drupal\migrate\Plugin\migrate\destination\EntityFile; +use Drupal\file\Plugin\migrate\destination\EntityFile; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\entity_test\Entity\EntityTest; use Drupal\migrate\MigrateException; @@ -18,7 +18,7 @@ /** * Tests the entity file destination plugin. * - * @group migrate + * @group file */ class EntityFileTest extends KernelTestBase { @@ -30,7 +30,7 @@ class EntityFileTest extends KernelTestBase { public static $modules = array('system', 'entity_test', 'user', 'file'); /** - * @var \Drupal\migrate\Tests\TestEntityFile $destination + * @var \Drupal\file\Tests\Migrate\TestEntityFile $destination */ protected $destination; diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateFileConfigsTest.php similarity index 84% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateFileConfigsTest.php index 4e974a03eef1e51e805df07176292ecddfb47a5b..c7964e4f698aa14f1560ac265ee7284ffb23a7a7 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateFileConfigsTest.php @@ -2,17 +2,18 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateFileConfigsTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateFileConfigsTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; use Drupal\config\Tests\SchemaCheckTestTrait; +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to file.settings.yml. * - * @group migrate_drupal + * @group file */ class MigrateFileConfigsTest extends MigrateDrupal6TestBase { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php similarity index 95% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php index fa4d5c8323db0f3007b6c5316c7b5eff66510510..c5b68fc315fda375cd58310d42e8f9f26461067c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php @@ -2,21 +2,22 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateFileTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateFileTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; use Drupal\Component\Utility\Random; use Drupal\migrate\Tests\MigrateDumpAlterInterface; use Drupal\Core\Database\Database; +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\simpletest\TestBase; use Drupal\file\Entity\File; /** * file migration. * - * @group migrate_drupal + * @group file */ class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlterInterface { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php similarity index 93% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php index 2f4936097a6a613c7e4e79f0c25fbbe49e6ec81d..17ea473107392ec3c9a670e0fed2e03eb7585227 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php @@ -2,10 +2,12 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadBase. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadBase. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; + +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Base class for file/upload migration tests. diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php similarity index 90% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php index c48bbbda3d23d25021e4a83e913f077f699e5b73..ff170a31562d87413e7a90265f971e6cc4f6e267 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php @@ -2,15 +2,17 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadEntityDisplayTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadEntityDisplayTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; + +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upload entity display. * - * @group migrate_drupal + * @group file */ class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php similarity index 90% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php index 3555fcc624c6a50fbcbcf654ab9f56bac09b8b79..b72f6456378d97465bad1e613d97de297ad780ba 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php @@ -2,15 +2,17 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadEntityFormDisplayTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadEntityFormDisplayTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; + +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upload form entity display. * - * @group migrate_drupal + * @group file */ class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php similarity index 81% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php index f4be6e2c4b53d2a9ea534bfbfc539f983442c3fb..0d8b4a6f9feb1496ea3eb472a7b2621cb0d3a2fa 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php @@ -2,17 +2,18 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadFieldTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadFieldTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; use Drupal\field\Entity\FieldStorageConfig; +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Uploads migration. * - * @group migrate_drupal + * @group file */ class MigrateUploadFieldTest extends MigrateDrupal6TestBase { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php similarity index 92% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php index b1ce798f35cc47785502e40d1865d55a5d7e22e5..1a61af708732e694153d81fb447a11cabdbc48bd 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php @@ -2,17 +2,18 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadInstanceTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadInstanceTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; use Drupal\field\Entity\FieldConfig; +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upload field instance migration. * - * @group migrate_drupal + * @group file */ class MigrateUploadInstanceTest extends MigrateDrupal6TestBase { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php similarity index 91% rename from core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php rename to core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php index 218fec095e8031cde09685c76c357f88748759c5..c5451139174cfab118885f7916275a05490480c2 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadTest. + * Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadTest. */ -namespace Drupal\migrate_drupal\Tests\d6; +namespace Drupal\file\Tests\Migrate\d6; use Drupal\node\Entity\Node; /** * Migrate association data between nodes and files. * - * @group migrate_drupal + * @group file */ class MigrateUploadTest extends MigrateUploadBase { diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/FileTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/source/d6/FileTest.php similarity index 84% rename from core/modules/migrate_drupal/tests/src/Unit/source/d6/FileTest.php rename to core/modules/file/tests/src/Unit/Plugin/migrate/source/d6/FileTest.php index 52614c9003bc5ad0fb26e355a2828868887e5a4b..90cbafe143ccc5eb244908a6ac11fd68ec50d803 100644 --- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/FileTest.php +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/source/d6/FileTest.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\Tests\migrate_drupal\Unit\source\d6\FileTest. + * Contains \Drupal\Tests\file\Unit\Plugin\migrate\source\d6\FileTest. */ -namespace Drupal\Tests\migrate_drupal\Unit\source\d6; +namespace Drupal\Tests\file\Unit\Plugin\migrate\source\d6; use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase; /** * Tests D6 file source plugin. * - * @group migrate_drupal + * @group file */ class FileTest extends MigrateSqlSourceTestCase { - const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\d6\File'; + const PLUGIN_CLASS = 'Drupal\file\Plugin\migrate\source\d6\File'; // The fake Migration configuration entity. protected $migrationConfiguration = array( diff --git a/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml b/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml index f29367472a779585b65f0281de99481987ba6a44..86e801e1ff70d1a41a00e23de10062a041f6f530 100644 --- a/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml +++ b/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml @@ -50,14 +50,6 @@ migrate.source.variable_multirow: type: string label: 'Variable' -migrate.source.d6_upload_instance: - type: migrate_source_sql - label: 'Drupal 6 upload form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - migrate_entity_constant: type: mapping mapping: