Я пытаюсь перенести переведенные ссылки меню в Drupal 8 - PullRequest
0 голосов
/ 05 ноября 2019

Мне удалось сделать это с узлами, сначала создав английский, а затем валлийский узлы, но мне не удалось добиться успеха с элементами меню. Английский элемент создан хорошо, но я не могу понять, как структурировать YAML для валлийского. Приветствуются указатели или примеры YAML-файлов!

Текущий YAML - .....


            langcode: cy
            status: true
            id: menu_test_cy_v5
            migration_group: BANGOR-MENUS-CY
            label: 'TEST Create main menu links'
            source:
              plugin: 'csv'
              # Full path to the file.
              path: 'C:\test-menu_v5.csv'
              # Column delimiter. Comma (,) by default.
              delimiter: ','
              # Field enclosure. Double quotation marks (") by default.
              enclosure: '"'
              # The number of rows at the beginning which are not data.
              header_row_count: 1
              # The column(s) to use as a key. Each column specified will 
              # create an index in the migration table and too many columns 
              # may throw an index size error.
              ids:
                - id
              # Here we identify the columns of interest in the source file. 
              # Each numeric key is the 0-based index of the column. 
              # For each column, the key below is the field name assigned to 
              # the data on import, to be used in field mappings below. 
              # The value is a user-friendly string for display by the 
              # migration UI.
              fields:
                0:
                  name: id
                  label: 'Unique Id'
                1:
                  name: menu_name
                  label: 'bangor'
                2:
                  name: title_en
                  label: 'Title en'
                3:
                  name: path_en
                  label: 'Path en'
                4:
                  name: title_cy
                  label: 'Title cy'
                5:
                  name: path_cy
                  label: 'Path cy'   
                6:
                  name: weight
                  label: 'link weight'
                7:
                  name: expanded
                  label: 'Expanded' 
                8:
                  name: enabled
                  label: 'Enabled' 
                9:
                  name: external
                  label: 'External'
                10:
                  name: plid
                  label: 'Parent Link ID' 
                11:
                  name: parent_link_path
                  label: 'Parent Link path'           
            process:
              nid:
                plugin: migration
                source: id
                migration: menu_test_en_v5
              bundle:
                plugin: default_value
                default_value: menu_link_content
                language: 'cy'
              langcode:
                plugin: default_value
                default_value: 'cy'
              title: title_cy
              menu_name: menu_name
              link/uri:
                plugin: link_uri
                source:
                  - path_cy
                validate_route: false
              weight: weight
              expanded: expanded
              parent:
                plugin: menu_link_parent
                source:
                  - plid
                  - '@menu_name'
                  - parent_link_path
              enabled: enabled
              external: external
              link/options: '@opts'
            #Absolutely necessary if you don't want an error
            destination:
              plugin: entity:menu_link_content
              translations: true
            migration_dependencies:
              required:
                - menu_test_en_v5

Возможно, форматирование немного устаревшее!

Sam

...