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