741ccf2e915e481df81d627e077bd22b33c2a487
[yaffs-website] / web / core / modules / comment / migration_templates / d6_comment_field_instance.yml
1 id: d6_comment_field_instance
2 label: Comment field instance configuration
3 migration_tags:
4   - Drupal 6
5 source:
6   plugin: d6_node_type
7   constants:
8     entity_type: node
9     label: Comments
10     required: true
11 process:
12   entity_type: 'constants/entity_type'
13   label: 'constants/label'
14   required: 'constants/required'
15   field_name:
16     -
17       plugin: migration_lookup
18       source: type
19       migration: d6_comment_type
20     -
21       plugin: skip_on_empty
22       method: row
23   bundle: type
24   'default_value/0/status':
25     # We're using static_map instead of default_value otherwise if the source
26     # is 0, the default value of 1 would be used.
27     plugin: static_map
28     source: comment
29     map:
30       0: 0
31       1: 1
32       2: 2
33     default_value: 2
34   'settings/default_mode':
35     plugin: static_map
36     source: comment_default_mode
37     map:
38       # COMMENT_MODE_FLAT_COLLAPSED --> COMMENT_MODE_FLAT
39       1: 0
40       # COMMENT_MODE_FLAT_EXPANDED --> COMMENT_MODE_FLAT
41       2: 0
42       # COMMENT_MODE_THREADED_COLLAPSED --> COMMENT_MODE_THREADED
43       3: 1
44       # COMMENT_MODE_THREADED_EXPANDED --> COMMENT_MODE_THREADED
45       4: 1
46     default_value: 1
47   'settings/per_page':
48     plugin: default_value
49     source: comment_default_per_page
50     default_value: 50
51   'settings/anonymous':
52     plugin: default_value
53     source: comment_anonymous
54     default_value: 0
55   'settings/form_location':
56     plugin: default_value
57     source: comment_form_location
58     default_value: 0
59   'settings/preview':
60     # We're using static_map instead of default_value otherwise if the source
61     # is 0, the default value of 1 would be used.
62     plugin: static_map
63     source: comment_preview
64     map:
65       0: 0
66       1: 1
67     default_value: 1
68 destination:
69   plugin: entity:field_config
70 migration_dependencies:
71   required:
72     - d6_node_type
73     - d6_comment_field