Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / field / migrations / d7_field_formatter_settings.yml
1 id: d7_field_formatter_settings
2 label: Field formatter configuration
3 migration_tags:
4   - Drupal 7
5   - Configuration
6 class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
7 field_plugin_method: processFieldFormatter
8 source:
9   plugin: d7_field_instance_per_view_mode
10   constants:
11     third_party_settings: { }
12 process:
13   # We skip field types that don't exist because they weren't migrated by the
14   # field migration.
15   field_type_exists:
16     -
17       plugin: migration_lookup
18       migration: d7_field
19       source:
20         - field_name
21         - entity_type
22     -
23       plugin: extract
24       index:
25         - 0
26     -
27       plugin: skip_on_empty
28       method: row
29   entity_type: entity_type
30   # The bundle needs to be statically mapped in order to support comment types
31   # that might already exist before this migration is run. See
32   # d7_comment_type.yml or more information.
33   bundle:
34     plugin: static_map
35     source: bundle
36     bypass: true
37     map:
38       comment_node_forum: comment_forum
39   view_mode:
40     -
41       plugin: migration_lookup
42       migration: d7_view_modes
43       source:
44         - entity_type
45         - view_mode
46     -
47       plugin: extract
48       index:
49         - 1
50     -
51       plugin: static_map
52       bypass: true
53       map:
54         full: default
55   field_name: field_name
56   "options/label": 'formatter/label'
57   "options/weight": 'formatter/weight'
58   # The field plugin ID.
59   plugin_id:
60     plugin: process_field
61     source: type
62     method: getPluginId
63   # The formatter to use.
64   formatter_type:
65     plugin: process_field
66     source: type
67     method: getFieldFormatterType
68   "options/type":
69     -
70       plugin: static_map
71       bypass: true
72       source:
73         - '@plugin_id'
74         - '@formatter_type'
75       # The map is generated by the getFieldFormatterMap() method from the
76       # migrate field plugins.
77       map: []
78     -
79       plugin: d7_field_type_defaults
80     -
81       plugin: skip_on_empty
82       method: row
83   "options/settings":
84     plugin: default_value
85     source: 'formatter/settings'
86     default_value: []
87   "options/third_party_settings": 'constants/third_party_settings'
88 destination:
89   plugin: component_entity_display
90 migration_dependencies:
91   required:
92     - d7_field_instance
93     - d7_view_modes