From f6d8fa955e31128593a7952d3aeb40d6ba4fa153 Mon Sep 17 00:00:00 2001 From: David Valdez Date: Wed, 31 Jul 2019 19:42:53 -0500 Subject: [PATCH] Add the Article type vocabulary with two terms. --- .../migrations/upgrade_d7_node_story.yml | 12 +-- .../upgrade_d7_taxonomy_term_vocabulary_3.yml | 73 +++++++++++++++++++ .../upgrade_d7_taxonomy_vocabulary.yml | 1 + 3 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_term_vocabulary_3.yml diff --git a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_node_story.yml b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_node_story.yml index 55c4fe3..27f82cf 100644 --- a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_node_story.yml +++ b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_node_story.yml @@ -109,12 +109,12 @@ process: source: taxonomy_vocabulary_2 process: target_id: tid -# taxonomy_vocabulary_3: -# - -# plugin: sub_process -# source: taxonomy_vocabulary_3 -# process: -# target_id: tid + field_article_type: + - + plugin: sub_process + source: taxonomy_vocabulary_3 + process: + target_id: tid # taxonomy_vocabulary_5: # - # plugin: sub_process diff --git a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_term_vocabulary_3.yml b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_term_vocabulary_3.yml new file mode 100644 index 0000000..4babf49 --- /dev/null +++ b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_term_vocabulary_3.yml @@ -0,0 +1,73 @@ +langcode: en +status: true +dependencies: { } +id: upgrade_d7_taxonomy_term_vocabulary_3 +class: Drupal\migrate\Plugin\Migration +field_plugin_method: alterFieldFormatterMigration +cck_plugin_method: null +migration_tags: + - 'Drupal 7' + - Content +migration_group: migrate_drupal_7_geo +label: 'Taxonomy terms (Departments)' +source: + plugin: d7_taxonomy_term + bundle: vocabulary_3 +process: + tid: + - + plugin: skip_on_value + method: row + source: tid + not_equals: true + # Only migrate these terms. + value: + - 17 # Reviews. + - 50 # Articles (renamed as GEO Original) + - + plugin: get + vid: + - + plugin: migration_lookup + migration: upgrade_d7_taxonomy_vocabulary + source: vid + name: + - + plugin: static_map + source: name + # Articles is going to be renamed as 'Geo Original' + map: + 'Articles' : 'GEO Original' + bypass: TRUE + description/value: + - + plugin: get + source: description + description/format: + - + plugin: get + source: format + weight: + - + plugin: get + source: weight + parent: '0' + forum_container: + - + plugin: get + source: is_container + changed: + - + plugin: get + source: timestamp + langcode: + - + plugin: get + source: language +destination: + plugin: 'entity:taxonomy_term' + default_bundle: article_type +migration_dependencies: + required: + - upgrade_d7_taxonomy_vocabulary + optional: { } diff --git a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_vocabulary.yml b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_vocabulary.yml index 2a55a03..db45346 100644 --- a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_vocabulary.yml +++ b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_taxonomy_vocabulary.yml @@ -32,6 +32,7 @@ process: value: - vocabulary_1 - vocabulary_2 + # - vocabulary_3 This was created manually and renamed as "article type" - vocabulary_7 - vocabulary_10 - vocabulary_12