Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / content_translation / migrations / node_translation_menu_links.yml
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 an URI of the form "base:node/<ID>".
42       plugin: link_uri
43       source:
44         - 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_translation
66         - d7_node_translation
67       no_stub: true
68     -
69       # Skip row if the new node ID is empty.
70       plugin: skip_on_empty
71       method: row
72     -
73       # Extract the node ID. The migration lookup will return an array with two
74       # items, the new node ID and the translation langcode. We need the node ID
75       # which is at index 0.
76       plugin: extract
77       index:
78         - 0
79   # This will be used in the "link/uri" and "route" processes below.
80   link_path:
81     plugin: concat
82     source:
83       - 'constants/node_prefix'
84       - '@new_nid'
85   link/uri:
86     plugin: concat
87     source:
88       - 'constants/entity_prefix'
89       - '@link_path'
90   link/options: options
91   route:
92     plugin: route
93     source:
94       - '@link_path'
95       - options
96   route_name: '@route/route_name'
97   route_parameters: '@route/route_parameters'
98   url: '@route/url'
99   options: '@route/options'
100   external: external
101   weight: weight
102   expanded: expanded
103   enabled: enabled
104   parent:
105     plugin: menu_link_parent
106     source:
107       - plid
108       - '@menu_name'
109       - parent_link_path
110   changed: updated
111 destination:
112   plugin: entity:menu_link_content
113   default_bundle: menu_link_content
114   no_stub: true
115 migration_dependencies:
116   optional:
117     - d6_menu_links
118     - d6_node_translation
119     - d7_menu_links
120     - d7_node_translation