Issue #2534012 by phenaproxima, hussainweb, mikeryan: Move module-specific migration support into the file module
							parent
							
								
									d904faacf1
								
							
						
					
					
						commit
						8bf9a8c556
					
				| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
migrate.destination.entity:file:
 | 
			
		||||
  type: migrate_destination
 | 
			
		||||
  label: 'File'
 | 
			
		||||
  mapping:
 | 
			
		||||
    source_path_property:
 | 
			
		||||
      type: string
 | 
			
		||||
      label: 'Source path'
 | 
			
		||||
| 
						 | 
				
			
			@ -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'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,6 @@ migration_tags:
 | 
			
		|||
  - Drupal 6
 | 
			
		||||
source:
 | 
			
		||||
  plugin: d6_upload
 | 
			
		||||
 | 
			
		||||
process:
 | 
			
		||||
  nid: nid
 | 
			
		||||
  vid: vid
 | 
			
		||||
| 
						 | 
				
			
			@ -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\Core\StreamWrapper\StreamWrapperManagerInterface;
 | 
			
		|||
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;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			@ -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 @@ use Drupal\simpletest\KernelTestBase;
 | 
			
		|||
/**
 | 
			
		||||
 * 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;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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(
 | 
			
		||||
| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue