Commit 732300b8 authored by catch's avatar catch
Browse files

Issue #2625696 by chx, benjy, alexpott, catch, mikeryan, andypost,...

Issue #2625696 by chx, benjy, alexpott, catch, mikeryan, andypost, phenaproxima: Make migrations themselves plugins instead of config entities
parent afb2a792
......@@ -16,15 +16,3 @@ block_content.type.*:
description:
type: text
label: 'Description'
migrate.source.d6_box:
type: migrate_source_sql
label: 'Drupal 6 box'
mapping:
constants:
type: mapping
label: 'Constants'
mapping:
type:
type: string
label: 'Type'
......@@ -20,4 +20,4 @@ destination:
plugin: book
migration_dependencies:
required:
- d6_node:*
- d6_node
......@@ -30,7 +30,7 @@ protected function setUp() {
$this->installSchema('book', ['book']);
$this->installSchema('node', ['node_access']);
$this->migrateContent();
$this->executeMigration('d6_book');
$this->executeMigrations(['d6_node', 'd6_book']);
}
/**
......
migrate.source.d6_comment:
type: migrate_source_sql
label: 'Drupal 6 comment'
mapping:
constants:
type: mapping
label: 'Constants'
mapping:
entity_type:
type: string
label: 'Entity type'
migrate.source.d6_comment_variable_per_comment_type:
type: migrate_source_sql
label: 'Drupal 6 comment variable'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d6_comment_entity_form_display_subject:
type: migrate_source_sql
label: 'Drupal 6 comment subject entity form display'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d6_comment_variable:
type: migrate_source_sql
label: 'Drupal 6 comment variable'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
......@@ -37,7 +37,7 @@ destination:
plugin: entity:comment
migration_dependencies:
required:
- d6_node:*
- d6_node
- d6_comment_type
- d6_comment_entity_display
- d6_comment_entity_form_display
......
......@@ -31,5 +31,5 @@ destination:
plugin: entity:comment
migration_dependencies:
required:
- d7_node:*
- d7_node
- d7_comment_type
......@@ -40,6 +40,7 @@ protected function setUp() {
$this->migrateContent();
$this->executeMigrations([
'd6_node',
'd6_comment_type',
'd6_comment_field',
'd6_comment_field_instance',
......
......@@ -40,12 +40,12 @@ protected function setUp() {
// We only need the test_content_type node migration to run for real, so
// mock all the others.
$this->prepareMigrations(array(
'd7_node:*' => array(
'd7_node' => array(
array(array(0), array(0)),
),
));
$this->executeMigrations([
'd7_node__test_content_type',
'd7_node:test_content_type',
'd7_comment_type',
'd7_comment',
]);
......
......@@ -9,7 +9,6 @@
use Drupal\comment\CommentTypeInterface;
use Drupal\comment\Entity\CommentType;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
......@@ -60,9 +59,8 @@ public function testMigration() {
$this->assertEntity('comment_node_forum', 'Forum topic comment');
$this->assertEntity('comment_node_test_content_type', 'Test content type comment');
$migration = $this->getMigration('d7_comment_type');
// Validate that the source count and processed count match up.
/** @var \Drupal\migrate\Entity\MigrationInterface $migration */
$migration = Migration::load('d7_comment_type');
$this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount());
}
......
# Schema for the migration source plugins.
migrate.source.contact_settings:
type: migrate_source_sql
label: 'Drupal contact settings'
mapping:
variables:
type: sequence
label: 'Variables'
sequence:
type: string
label: 'Variable'
migrate.source.d6_field_instance_per_form_display:
type: migrate_source_sql
label: 'Drupal 6 field instance form display'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d6_field:
type: migrate_source_sql
label: 'Drupal 6 field'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d6_field_formatter_settings:
type: migrate_source_sql
label: 'Drupal 6 field formatter settings'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d6_field_instance:
type: migrate_source_sql
label: 'Drupal 6 field instance'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d6_field_instance_per_view_mode:
type: migrate_source_sql
label: 'Drupal 6 field formatter'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d7_field:
type: migrate_source_sql
label: 'Drupal 7 field'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d7_field_instance:
type: migrate_source_sql
label: 'Drupal 7 field instance'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d7_field_instance_per_form_display:
type: migrate_source_sql
label: 'Drupal 7 field instance per form display'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
migrate.source.d7_field_instance_per_view_mode:
type: migrate_source_sql
label: 'Drupal 7 field instance per view mode'
mapping:
constants:
type: migrate_entity_constant
label: 'Constants'
......@@ -2,9 +2,8 @@ id: d6_field
label: Field configuration
migration_tags:
- Drupal 6
builder:
plugin: d6_cck_migration
cck_plugin_method: processField
class: Drupal\migrate_drupal\Plugin\migrate\CckMigration
cck_plugin_method: processField
source:
plugin: d6_field
constants:
......
......@@ -2,9 +2,8 @@ id: d6_field_formatter_settings
label: Field formatter configuration
migration_tags:
- Drupal 6
builder:
plugin: d6_cck_migration
cck_plugin_method: processFieldFormatter
class: Drupal\migrate_drupal\Plugin\migrate\CckMigration
cck_plugin_method: processFieldFormatter
source:
plugin: d6_field_instance_per_view_mode
constants:
......
......@@ -2,9 +2,8 @@ id: d6_field_instance
label: Field instance configuration
migration_tags:
- Drupal 6
builder:
plugin: d6_cck_migration
cck_plugin_method: processFieldInstance
class: Drupal\migrate_drupal\Plugin\migrate\CckMigration
cck_plugin_method: processFieldInstance
source:
plugin: d6_field_instance
constants:
......
......@@ -2,9 +2,8 @@ id: d6_field_instance_widget_settings
label: Field instance widget configuration
migration_tags:
- Drupal 6
builder:
plugin: d6_cck_migration
cck_plugin_method: processFieldWidget
class: Drupal\migrate_drupal\Plugin\migrate\CckMigration
cck_plugin_method: processFieldWidget
source:
plugin: d6_field_instance_per_form_display
constants:
......
......@@ -15,6 +15,7 @@
*
* @MigrateSource(
* id = "d7_field_instance",
* source_provider = "field"
* )
*/
class FieldInstance extends DrupalSqlBase {
......
......@@ -8,7 +8,6 @@
namespace Drupal\field\Tests\Migrate\d6;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/**
......@@ -181,7 +180,7 @@ public function testEntityDisplaySettings() {
$component = $display->getComponent('field_test_datetime');
$this->assertIdentical($expected, $component);
// Test that our Id map has the correct data.
$this->assertIdentical(array('node', 'story', 'teaser', 'field_test'), Migration::load('d6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test')));
$this->assertIdentical(array('node', 'story', 'teaser', 'field_test'), $this->getMigration('d6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test')));
}
}
......@@ -8,7 +8,6 @@
namespace Drupal\field\Tests\Migrate\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/**
......@@ -98,7 +97,7 @@ public function testFields() {
// Validate that the source count and processed count match up.
/** @var \Drupal\migrate\Entity\MigrationInterface $migration */
$migration = Migration::load('d6_field');
$migration = $this->getMigration('d6_field');
$this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount());
// Check that we've reported on a conflict in widget_types.
......
......@@ -9,7 +9,6 @@
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
......@@ -116,7 +115,7 @@ public function testFields() {
// Validate that the source count and processed count match up.
/** @var \Drupal\migrate\Entity\MigrationInterface $migration */
$migration = Migration::load('d7_field');
$migration = $this->getMigration('d7_field');
$this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount());
}
......
migrate.destination.entity:file:
type: migrate_destination
label: 'File'
mapping:
source_path_property:
type: string
label: 'Source path'
source_base_path:
type: string
label: 'Source base path'
urlencode:
type: boolean
label: 'Whether to urlencode incoming file paths'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment