node_translation_menu_links.yml

Same filename in other branches
  1. 9 core/modules/content_translation/migrations/node_translation_menu_links.yml
  2. 8.9.x core/modules/content_translation/migrations/node_translation_menu_links.yml
  3. 11.x core/modules/content_translation/migrations/node_translation_menu_links.yml
core/modules/content_translation/migrations/node_translation_menu_links.yml

File

core/modules/content_translation/migrations/node_translation_menu_links.yml

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.