diff --git a/core/modules/comment/migration_templates/d6_comment.yml b/core/modules/comment/migration_templates/d6_comment.yml index ade18f9..a7ffc9d 100644 --- a/core/modules/comment/migration_templates/d6_comment.yml +++ b/core/modules/comment/migration_templates/d6_comment.yml @@ -9,10 +9,9 @@ source: process: cid: cid pid: - plugin: entity_parent + plugin: migration migration: d6_comment source: pid - none: NULL entity_id: nid entity_type: 'constants/entity_type' # field_name & comment_type is calculated in diff --git a/core/modules/comment/migration_templates/d7_comment.yml b/core/modules/comment/migration_templates/d7_comment.yml index dac9232..5845999 100644 --- a/core/modules/comment/migration_templates/d7_comment.yml +++ b/core/modules/comment/migration_templates/d7_comment.yml @@ -9,10 +9,9 @@ source: process: cid: cid pid: - plugin: entity_parent + plugin: migration migration: d7_comment source: pid - none: NULL entity_id: nid entity_type: 'constants/entity_type' comment_type: comment_type diff --git a/core/modules/migrate/src/Plugin/migrate/process/Migration.php b/core/modules/migrate/src/Plugin/migrate/process/Migration.php index 5017437..6a24495 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Migration.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Migration.php @@ -155,7 +155,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable } /** - * Skips the migration process entirely if the value is NULL. + * Skips the migration process entirely if the value is FALSE. * * @param mixed $value * The incoming value to transform. @@ -163,12 +163,9 @@ public function transform($value, MigrateExecutableInterface $migrate_executable * @throws \Drupal\migrate\MigrateSkipProcessException */ protected function skipOnEmpty($value) { - foreach ($value as $v) { - if (!is_null($v)) { - return; - } + if (!array_filter($value)) { + throw new MigrateSkipProcessException(); } - throw new MigrateSkipProcessException(); } } diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/EntityParent.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/EntityParent.php deleted file mode 100644 index 98f33ca..0000000 --- a/core/modules/migrate_drupal/src/Plugin/migrate/process/EntityParent.php +++ /dev/null @@ -1,31 +0,0 @@ -configuration['none']; - } - - return parent::transform($value, $migrate_executable, $row, $destination_property); - } - -} diff --git a/core/modules/taxonomy/migration_templates/d6_taxonomy_term.yml b/core/modules/taxonomy/migration_templates/d6_taxonomy_term.yml index e179d2e..cd1601d 100644 --- a/core/modules/taxonomy/migration_templates/d6_taxonomy_term.yml +++ b/core/modules/taxonomy/migration_templates/d6_taxonomy_term.yml @@ -13,11 +13,16 @@ process: name: name description: description weight: weight + parent_id: + - plugin: skip_on_empty + method: process + source: parent + - plugin: migration + migration: d6_taxonomy_term parent: - plugin: entity_parent - migration: d6_taxonomy_term - source: parent - none: 0 + plugin: default_value + default_value: 0 + source: '@parent_id' changed: timestamp destination: plugin: entity:taxonomy_term diff --git a/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml b/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml index d8c78b6..7546660 100644 --- a/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml +++ b/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml @@ -7,17 +7,16 @@ source: process: tid: tid vid: - plugin: entity_parent + plugin: migration migration: d7_taxonomy_vocabulary source: vid name: name description: description weight: weight parent: - plugin: entity_parent + plugin: migration migration: d7_taxonomy_term source: parent - none: 0 changed: timestamp destination: plugin: entity:taxonomy_term