Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / taxonomy / migrations / d6_vocabulary_field_instance.yml
diff --git a/web/core/modules/taxonomy/migrations/d6_vocabulary_field_instance.yml b/web/core/modules/taxonomy/migrations/d6_vocabulary_field_instance.yml
new file mode 100644 (file)
index 0000000..2c482e2
--- /dev/null
@@ -0,0 +1,59 @@
+id: d6_vocabulary_field_instance
+label: Vocabulary field instance configuration
+migration_tags:
+  - Drupal 6
+  - Configuration
+source:
+  plugin: d6_taxonomy_vocabulary_per_type
+  constants:
+    entity_type: node
+    auto_create: true
+    selection_handler: 'default:taxonomy_term'
+    field_prefix: field_
+process:
+  entity_type: 'constants/entity_type'
+  bundle:
+    -
+      plugin: migration_lookup
+      migration: d6_node_type
+      source: type
+    -
+      plugin: skip_on_empty
+      method: row
+  # This value is only used in the 'field_name' process pipeline below.
+  raw_field_name:
+    -
+      plugin: migration_lookup
+      migration: d6_taxonomy_vocabulary
+      source: vid
+    -
+      plugin: skip_on_empty
+      method: row
+  field_name:
+    # Prepend field_ to avoid conflicts with base fields, and make sure the
+    # result is no longer than 32 characters.
+    -
+      plugin: concat
+      source:
+        - constants/field_prefix
+        - '@raw_field_name'
+    -
+      plugin: substr
+      length: 32
+    -
+      # This plugin checks if the vocabulary being migrated is the one used by
+      # Forum. If so, we use the machine name that Forum expects. Otherwise, we
+      # leave it unchanged.
+      plugin: forum_vocabulary
+      machine_name: taxonomy_forums
+  label: name
+  'settings/handler': 'constants/selection_handler'
+  'settings/handler_settings/target_bundles/0': '@field_name'
+  'settings/handler_settings/auto_create': 'constants/auto_create'
+  required: required
+destination:
+  plugin: entity:field_config
+migration_dependencies:
+  required:
+    - d6_node_type
+    - d6_vocabulary_field