You are here

d7_field_formatter_settings.yml in Drupal 9

core/modules/field/migrations/d7_field_formatter_settings.yml

File

core/modules/field/migrations/d7_field_formatter_settings.yml
View source
  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: alterFieldFormatterMigration
  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. -
  35. plugin: migration_lookup
  36. migration: d7_field_instance
  37. source:
  38. - entity_type
  39. - bundle
  40. - field_name
  41. -
  42. plugin: extract
  43. index:
  44. - 1
  45. view_mode:
  46. -
  47. plugin: migration_lookup
  48. migration: d7_view_modes
  49. source:
  50. - entity_type
  51. - view_mode
  52. -
  53. plugin: extract
  54. index:
  55. - 1
  56. -
  57. plugin: static_map
  58. bypass: true
  59. map:
  60. full: default
  61. field_name: field_name
  62. "options/label": 'formatter/label'
  63. "options/weight": 'formatter/weight'
  64. # The field plugin ID.
  65. plugin_id:
  66. plugin: process_field
  67. source: type
  68. method: getPluginId
  69. # The formatter to use.
  70. formatter_type:
  71. plugin: process_field
  72. source: type
  73. method: getFieldFormatterType
  74. "options/type":
  75. -
  76. plugin: static_map
  77. bypass: true
  78. source:
  79. - '@plugin_id'
  80. - '@formatter_type'
  81. # The map is generated by the getFieldFormatterMap() method from the
  82. # migrate field plugins.
  83. map: []
  84. -
  85. plugin: d7_field_type_defaults
  86. -
  87. plugin: skip_on_empty
  88. method: row
  89. hidden:
  90. plugin: static_map
  91. source: "@options/type"
  92. map:
  93. hidden: true
  94. default_value: false
  95. "options/settings":
  96. plugin: default_value
  97. source: 'formatter/settings'
  98. default_value: []
  99. "options/third_party_settings": 'constants/third_party_settings'
  100. destination:
  101. plugin: component_entity_display
  102. migration_dependencies:
  103. required:
  104. - d7_field_instance
  105. - d7_view_modes