You are here

node_translation_menu_links.yml in Drupal 9

core/modules/content_translation/migrations/node_translation_menu_links.yml

File

core/modules/content_translation/migrations/node_translation_menu_links.yml
View source
  1. id: node_translation_menu_links
  2. label: Node Translations Menu links
  3. audit: true
  4. migration_tags:
  5. - Drupal 6
  6. - Drupal 7
  7. - Content
  8. - Multilingual
  9. source:
  10. plugin: menu_link
  11. constants:
  12. entity_prefix: 'entity:'
  13. node_prefix: 'node/'
  14. process:
  15. id: mlid
  16. title: link_title
  17. description: description
  18. menu_name:
  19. -
  20. plugin: migration_lookup
  21. # The menu migration is in the system module.
  22. migration:
  23. - d6_menu
  24. - d7_menu
  25. source: menu_name
  26. -
  27. plugin: skip_on_empty
  28. method: row
  29. -
  30. plugin: static_map
  31. map:
  32. management: admin
  33. bypass: true
  34. # In this process pipeline, given a menu link path that might be for a
  35. # translated node which has been merged with the default language node, we are
  36. # trying to determine the new node ID, that is the ID of the default language
  37. # node.
  38. new_nid:
  39. -
  40. # If the path is of the form "node/<ID>" and is not routed, we will get
  41. # back a URI of the form "base:node/<ID>".
  42. plugin: link_uri
  43. source: link_path
  44. validate_route: false
  45. -
  46. # Isolate the node ID.
  47. plugin: explode
  48. delimiter: 'base:node/'
  49. -
  50. # Extract the node ID.
  51. plugin: extract
  52. default: false
  53. index:
  54. - 1
  55. -
  56. # Skip row if node ID is empty.
  57. plugin: skip_on_empty
  58. method: row
  59. -
  60. # With the old node ID in hand, lookup in the d6_node_translation or
  61. # d7_node_translation mapping tables to find the new node ID.
  62. plugin: migration_lookup
  63. migration:
  64. - d6_node_complete
  65. - d7_node_complete
  66. - d6_node_translation
  67. - d7_node_translation
  68. no_stub: true
  69. -
  70. # Skip row if the new node ID is empty.
  71. plugin: skip_on_empty
  72. method: row
  73. -
  74. # Extract the node ID. The migration lookup will return an array with two
  75. # items, the new node ID and the translation langcode. We need the node ID
  76. # which is at index 0.
  77. plugin: extract
  78. index:
  79. - 0
  80. # This will be used in the "link/uri" and "route" processes below.
  81. link_path:
  82. plugin: concat
  83. source:
  84. - 'constants/node_prefix'
  85. - '@new_nid'
  86. link/uri:
  87. plugin: concat
  88. source:
  89. - 'constants/entity_prefix'
  90. - '@link_path'
  91. link/options: options
  92. route:
  93. plugin: route
  94. source:
  95. - '@link_path'
  96. - options
  97. route_name: '@route/route_name'
  98. route_parameters: '@route/route_parameters'
  99. url: '@route/url'
  100. options: '@route/options'
  101. external: external
  102. weight: weight
  103. expanded: expanded
  104. enabled: enabled
  105. parent:
  106. plugin: menu_link_parent
  107. source:
  108. - plid
  109. - '@menu_name'
  110. - parent_link_path
  111. changed: updated
  112. destination:
  113. plugin: entity:menu_link_content
  114. default_bundle: menu_link_content
  115. no_stub: true
  116. migration_dependencies:
  117. required:
  118. - language
  119. optional:
  120. - d6_menu
  121. - d6_menu_links
  122. - d6_node_translation
  123. - d7_menu
  124. - d7_menu_links
  125. - d7_node_translation