Initial Drupal 11 with DDEV setup
This commit is contained in:
		
							
								
								
									
										73
									
								
								web/core/modules/comment/migrations/d6_comment.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								web/core/modules/comment/migrations/d6_comment.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,73 @@
 | 
			
		||||
id: d6_comment
 | 
			
		||||
label: Comments
 | 
			
		||||
audit: true
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Content
 | 
			
		||||
source:
 | 
			
		||||
  plugin: d6_comment
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
process:
 | 
			
		||||
  # If you are using this file to build a custom migration consider removing
 | 
			
		||||
  # the cid field to allow incremental migrations.
 | 
			
		||||
  cid: cid
 | 
			
		||||
  pid:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: process
 | 
			
		||||
      source: pid
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      migration: d6_comment
 | 
			
		||||
  entity_id:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      migration:
 | 
			
		||||
        - d6_node_complete
 | 
			
		||||
        - d6_node
 | 
			
		||||
        - d6_node_translation
 | 
			
		||||
      source: nid
 | 
			
		||||
    -
 | 
			
		||||
      plugin: node_complete_node_lookup
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  comment_type:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d6_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  langcode: language
 | 
			
		||||
  field_name: '@comment_type'
 | 
			
		||||
  subject: subject
 | 
			
		||||
  uid: uid
 | 
			
		||||
  name: name
 | 
			
		||||
  mail: mail
 | 
			
		||||
  homepage: homepage
 | 
			
		||||
  hostname: hostname
 | 
			
		||||
  created: timestamp
 | 
			
		||||
  changed: timestamp
 | 
			
		||||
  status: status #In D6, published=0. We reverse the value in prepareRow.
 | 
			
		||||
  thread: thread
 | 
			
		||||
  'comment_body/value': comment
 | 
			
		||||
  'comment_body/format':
 | 
			
		||||
    plugin: migration_lookup
 | 
			
		||||
    migration: d6_filter_format
 | 
			
		||||
    source: format
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:comment
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d6_node
 | 
			
		||||
    - d6_comment_type
 | 
			
		||||
    - d6_comment_entity_display
 | 
			
		||||
    - d6_comment_entity_form_display
 | 
			
		||||
    - d6_user
 | 
			
		||||
    - d6_filter_format
 | 
			
		||||
  optional:
 | 
			
		||||
    - d6_node_translation
 | 
			
		||||
@ -0,0 +1,32 @@
 | 
			
		||||
id: d6_comment_entity_display
 | 
			
		||||
label: Comment display configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    view_mode: default
 | 
			
		||||
    options:
 | 
			
		||||
      label: hidden
 | 
			
		||||
      type: comment_default
 | 
			
		||||
      weight: 20
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d6_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  view_mode: 'constants/view_mode'
 | 
			
		||||
  options: 'constants/options'
 | 
			
		||||
  bundle: type
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: component_entity_display
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d6_comment_field_instance
 | 
			
		||||
@ -0,0 +1,31 @@
 | 
			
		||||
id: d6_comment_entity_form_display
 | 
			
		||||
label: Comment field form display configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    form_mode: default
 | 
			
		||||
    options:
 | 
			
		||||
      type: comment_default
 | 
			
		||||
      weight: 20
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d6_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  form_mode: 'constants/form_mode'
 | 
			
		||||
  options: 'constants/options'
 | 
			
		||||
  bundle: type
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: component_entity_form_display
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d6_comment_field_instance
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
id: d6_comment_entity_form_display_subject
 | 
			
		||||
label: Comment subject form display configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: comment
 | 
			
		||||
    field_name: subject
 | 
			
		||||
    form_mode: default
 | 
			
		||||
    options:
 | 
			
		||||
      type: string_textfield
 | 
			
		||||
      weight: 10
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name: 'constants/field_name'
 | 
			
		||||
  form_mode: 'constants/form_mode'
 | 
			
		||||
  options: 'constants/options'
 | 
			
		||||
  bundle:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d6_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  hidden:
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment_subject_field
 | 
			
		||||
    map:
 | 
			
		||||
      # If comment_subject_field = FALSE, then hidden = TRUE.
 | 
			
		||||
      0: true
 | 
			
		||||
      # If comment_subject_field = TRUE, then hidden = FALSE.
 | 
			
		||||
      1: false
 | 
			
		||||
    default_value: false
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: component_entity_form_display
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d6_comment_type
 | 
			
		||||
							
								
								
									
										27
									
								
								web/core/modules/comment/migrations/d6_comment_field.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								web/core/modules/comment/migrations/d6_comment_field.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
id: d6_comment_field
 | 
			
		||||
label: Comment field configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    type: comment
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d6_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  type: 'constants/type'
 | 
			
		||||
  'settings/comment_type': '@field_name'
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:field_storage_config
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d6_comment_type
 | 
			
		||||
@ -0,0 +1,74 @@
 | 
			
		||||
id: d6_comment_field_instance
 | 
			
		||||
label: Comment field instance configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    label: Comments
 | 
			
		||||
    required: true
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  label: 'constants/label'
 | 
			
		||||
  required: 'constants/required'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d6_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  bundle: type
 | 
			
		||||
  'default_value/0/status':
 | 
			
		||||
    # We're using static_map instead of default_value otherwise if the source
 | 
			
		||||
    # is 0, the default value of 1 would be used.
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment
 | 
			
		||||
    map:
 | 
			
		||||
      0: 0
 | 
			
		||||
      1: 1
 | 
			
		||||
      2: 2
 | 
			
		||||
    default_value: 2
 | 
			
		||||
  'settings/default_mode':
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment_default_mode
 | 
			
		||||
    map:
 | 
			
		||||
      # COMMENT_MODE_FLAT_COLLAPSED --> COMMENT_MODE_FLAT
 | 
			
		||||
      1: 0
 | 
			
		||||
      # COMMENT_MODE_FLAT_EXPANDED --> COMMENT_MODE_FLAT
 | 
			
		||||
      2: 0
 | 
			
		||||
      # COMMENT_MODE_THREADED_COLLAPSED --> COMMENT_MODE_THREADED
 | 
			
		||||
      3: 1
 | 
			
		||||
      # COMMENT_MODE_THREADED_EXPANDED --> COMMENT_MODE_THREADED
 | 
			
		||||
      4: 1
 | 
			
		||||
    default_value: 1
 | 
			
		||||
  'settings/per_page':
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: comment_default_per_page
 | 
			
		||||
    default_value: 50
 | 
			
		||||
  'settings/anonymous':
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: comment_anonymous
 | 
			
		||||
    default_value: 0
 | 
			
		||||
  'settings/form_location':
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: comment_form_location
 | 
			
		||||
    default_value: 0
 | 
			
		||||
  'settings/preview':
 | 
			
		||||
    # We're using static_map instead of default_value otherwise if the source
 | 
			
		||||
    # is 0, the default value of 1 would be used.
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment_preview
 | 
			
		||||
    map:
 | 
			
		||||
      0: 0
 | 
			
		||||
      1: 1
 | 
			
		||||
    default_value: 1
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:field_config
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d6_node_type
 | 
			
		||||
    - d6_comment_field
 | 
			
		||||
							
								
								
									
										40
									
								
								web/core/modules/comment/migrations/d6_comment_type.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								web/core/modules/comment/migrations/d6_comment_type.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
			
		||||
id: d6_comment_type
 | 
			
		||||
label: Comment type
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 6
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    id_prefix: 'comment_node_'
 | 
			
		||||
    label_suffix: 'comment'
 | 
			
		||||
process:
 | 
			
		||||
  target_entity_type_id: 'constants/entity_type'
 | 
			
		||||
  id:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: concat
 | 
			
		||||
      source:
 | 
			
		||||
        - 'constants/id_prefix'
 | 
			
		||||
        - type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: static_map
 | 
			
		||||
      bypass: true
 | 
			
		||||
      # The Forum module provides its own comment type (comment_forum), which we
 | 
			
		||||
      # want to reuse if it exists.
 | 
			
		||||
      map:
 | 
			
		||||
        comment_node_forum: comment_forum
 | 
			
		||||
    -
 | 
			
		||||
      plugin: make_unique_entity_field
 | 
			
		||||
      entity_type: comment_type
 | 
			
		||||
      field: id
 | 
			
		||||
      length: 30
 | 
			
		||||
      migrated: true
 | 
			
		||||
  label:
 | 
			
		||||
    plugin: concat
 | 
			
		||||
    source:
 | 
			
		||||
      - name
 | 
			
		||||
      - 'constants/label_suffix'
 | 
			
		||||
    delimiter: ' '
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:comment_type
 | 
			
		||||
							
								
								
									
										70
									
								
								web/core/modules/comment/migrations/d7_comment.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								web/core/modules/comment/migrations/d7_comment.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,70 @@
 | 
			
		||||
id: d7_comment
 | 
			
		||||
label: Comments
 | 
			
		||||
audit: true
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Content
 | 
			
		||||
class: Drupal\comment\Plugin\migrate\D7Comment
 | 
			
		||||
source:
 | 
			
		||||
  plugin: d7_comment
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
process:
 | 
			
		||||
  # If you are using this file to build a custom migration consider removing
 | 
			
		||||
  # the cid field to allow incremental migrations.
 | 
			
		||||
  cid: cid
 | 
			
		||||
  pid:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: process
 | 
			
		||||
      source: pid
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      migration: d7_comment
 | 
			
		||||
  entity_id:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      migration:
 | 
			
		||||
        - d7_node_complete
 | 
			
		||||
        - d7_node
 | 
			
		||||
        - d7_node_translation
 | 
			
		||||
      source: nid
 | 
			
		||||
    -
 | 
			
		||||
      plugin: node_complete_node_lookup
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  comment_type:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: node_type
 | 
			
		||||
      migration: d7_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  # Comments migrated from Drupal 6 to Drupal 7 may not have a language.
 | 
			
		||||
  langcode:
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: language
 | 
			
		||||
    default_value: und
 | 
			
		||||
  field_name: '@comment_type'
 | 
			
		||||
  subject: subject
 | 
			
		||||
  uid: uid
 | 
			
		||||
  name: name
 | 
			
		||||
  mail: mail
 | 
			
		||||
  homepage: homepage
 | 
			
		||||
  hostname: hostname
 | 
			
		||||
  created: created
 | 
			
		||||
  changed: changed
 | 
			
		||||
  status: status
 | 
			
		||||
  thread: thread
 | 
			
		||||
  comment_body: comment_body
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:comment
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d7_node
 | 
			
		||||
    - d7_comment_type
 | 
			
		||||
  optional:
 | 
			
		||||
    - d7_node_translation
 | 
			
		||||
@ -0,0 +1,32 @@
 | 
			
		||||
id: d7_comment_entity_display
 | 
			
		||||
label: Comment display configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    view_mode: default
 | 
			
		||||
    options:
 | 
			
		||||
      label: hidden
 | 
			
		||||
      type: comment_default
 | 
			
		||||
      weight: 20
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d7_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  view_mode: 'constants/view_mode'
 | 
			
		||||
  options: 'constants/options'
 | 
			
		||||
  bundle: type
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: component_entity_display
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d7_comment_field_instance
 | 
			
		||||
@ -0,0 +1,31 @@
 | 
			
		||||
id: d7_comment_entity_form_display
 | 
			
		||||
label: Comment field form display configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    form_mode: default
 | 
			
		||||
    options:
 | 
			
		||||
      type: comment_default
 | 
			
		||||
      weight: 20
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d7_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  form_mode: 'constants/form_mode'
 | 
			
		||||
  options: 'constants/options'
 | 
			
		||||
  bundle: type
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: component_entity_form_display
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d7_comment_field_instance
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
id: d7_comment_entity_form_display_subject
 | 
			
		||||
label: Comment subject form display configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: comment
 | 
			
		||||
    field_name: subject
 | 
			
		||||
    form_mode: default
 | 
			
		||||
    options:
 | 
			
		||||
      type: string_textfield
 | 
			
		||||
      weight: 10
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name: 'constants/field_name'
 | 
			
		||||
  form_mode: 'constants/form_mode'
 | 
			
		||||
  options: 'constants/options'
 | 
			
		||||
  bundle:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d7_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  hidden:
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment_subject_field
 | 
			
		||||
    map:
 | 
			
		||||
      # If comment_subject_field = FALSE, then hidden = TRUE.
 | 
			
		||||
      0: true
 | 
			
		||||
      # If comment_subject_field = TRUE, then hidden = FALSE.
 | 
			
		||||
      1: false
 | 
			
		||||
    default_value: false
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: component_entity_form_display
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d7_comment_type
 | 
			
		||||
							
								
								
									
										27
									
								
								web/core/modules/comment/migrations/d7_comment_field.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								web/core/modules/comment/migrations/d7_comment_field.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
id: d7_comment_field
 | 
			
		||||
label: Comment field configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    type: comment
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d7_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  type: 'constants/type'
 | 
			
		||||
  'settings/comment_type': '@field_name'
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:field_storage_config
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d7_comment_type
 | 
			
		||||
@ -0,0 +1,71 @@
 | 
			
		||||
id: d7_comment_field_instance
 | 
			
		||||
label: Comment field instance configuration
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    label: Comments
 | 
			
		||||
    required: true
 | 
			
		||||
process:
 | 
			
		||||
  entity_type: 'constants/entity_type'
 | 
			
		||||
  label: 'constants/label'
 | 
			
		||||
  required: 'constants/required'
 | 
			
		||||
  field_name:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: migration_lookup
 | 
			
		||||
      source: type
 | 
			
		||||
      migration: d7_comment_type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: skip_on_empty
 | 
			
		||||
      method: row
 | 
			
		||||
  bundle: type
 | 
			
		||||
  'default_value/0/status':
 | 
			
		||||
    # We're using static_map instead of default_value otherwise if the source
 | 
			
		||||
    # is 0, the default value of 1 would be used.
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment
 | 
			
		||||
    map:
 | 
			
		||||
      0: 0
 | 
			
		||||
      1: 1
 | 
			
		||||
      2: 2
 | 
			
		||||
    default_value: 2
 | 
			
		||||
  'settings/default_mode':
 | 
			
		||||
    # We're using static_map instead of default_value otherwise if the source
 | 
			
		||||
    # is 0, the default value of 1 would be used.
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment_default_mode
 | 
			
		||||
    map:
 | 
			
		||||
      0: 0
 | 
			
		||||
      1: 1
 | 
			
		||||
    default_value: 1
 | 
			
		||||
  'settings/per_page':
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: comment_default_per_page
 | 
			
		||||
    default_value: 50
 | 
			
		||||
  'settings/anonymous':
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: comment_anonymous
 | 
			
		||||
    default_value: 0
 | 
			
		||||
  'settings/form_location':
 | 
			
		||||
    plugin: default_value
 | 
			
		||||
    source: comment_form_location
 | 
			
		||||
    default_value: 0
 | 
			
		||||
  'settings/preview':
 | 
			
		||||
    # We're using static_map instead of default_value otherwise if the source
 | 
			
		||||
    # is 0, the default value of 1 would be used.
 | 
			
		||||
    plugin: static_map
 | 
			
		||||
    source: comment_preview
 | 
			
		||||
    map:
 | 
			
		||||
      0: 0
 | 
			
		||||
      1: 1
 | 
			
		||||
      2: 2
 | 
			
		||||
    default_value: 1
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:field_config
 | 
			
		||||
migration_dependencies:
 | 
			
		||||
  required:
 | 
			
		||||
    - d7_node_type
 | 
			
		||||
    - d7_comment_field
 | 
			
		||||
							
								
								
									
										40
									
								
								web/core/modules/comment/migrations/d7_comment_type.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								web/core/modules/comment/migrations/d7_comment_type.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
			
		||||
id: d7_comment_type
 | 
			
		||||
label: Comment type
 | 
			
		||||
migration_tags:
 | 
			
		||||
  - Drupal 7
 | 
			
		||||
  - Configuration
 | 
			
		||||
source:
 | 
			
		||||
  plugin: comment_type
 | 
			
		||||
  constants:
 | 
			
		||||
    entity_type: node
 | 
			
		||||
    id_prefix: 'comment_node_'
 | 
			
		||||
    label_suffix: 'comment'
 | 
			
		||||
process:
 | 
			
		||||
  target_entity_type_id: 'constants/entity_type'
 | 
			
		||||
  id:
 | 
			
		||||
    -
 | 
			
		||||
      plugin: concat
 | 
			
		||||
      source:
 | 
			
		||||
        - 'constants/id_prefix'
 | 
			
		||||
        - type
 | 
			
		||||
    -
 | 
			
		||||
      plugin: static_map
 | 
			
		||||
      bypass: true
 | 
			
		||||
      # The Forum module provides its own comment type (comment_forum), which we
 | 
			
		||||
      # want to reuse if it exists.
 | 
			
		||||
      map:
 | 
			
		||||
        comment_node_forum: comment_forum
 | 
			
		||||
    -
 | 
			
		||||
      plugin: make_unique_entity_field
 | 
			
		||||
      entity_type: comment_type
 | 
			
		||||
      field: id
 | 
			
		||||
      length: 30
 | 
			
		||||
      migrated: true
 | 
			
		||||
  label:
 | 
			
		||||
    plugin: concat
 | 
			
		||||
    source:
 | 
			
		||||
      - name
 | 
			
		||||
      - 'constants/label_suffix'
 | 
			
		||||
    delimiter: ' '
 | 
			
		||||
destination:
 | 
			
		||||
  plugin: entity:comment_type
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
finished:
 | 
			
		||||
  6:
 | 
			
		||||
    comment: comment
 | 
			
		||||
    node: comment
 | 
			
		||||
  7:
 | 
			
		||||
    comment: comment
 | 
			
		||||
    node: comment
 | 
			
		||||
		Reference in New Issue
	
	Block a user