Score:0

How to set the appropriate bundle for a paragraph on migration?

us flag

I'm trying to migrate some paragraphs from D7 to D9.

The bundle type is always set by the default_bundle setting for the destination migration eg:

destination:
 plugin: 'entity_reference_revisions:paragraph'
 default_bundle: text

Can anyone sign post me to a good example of a yml file that sets this for paragraphs with more than one field?

Here is the whole yml file:

langcode: en
status: true
dependencies: { }
id: paragraph_text
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags:
 - 'Drupal 7'
migration_group: migrate_drupal_7
label: Text Paragraphs
source:
 plugin: d7_paragraph_item
 key: migrate
#  field_name is used in our custom plugin to get data about the paragraph item.
 field_name: field_paragraphs
process:
 temp_bundle_type:
  plugin: static_map
  source: target_bundle
  bypass: true  
  source: format  
  map:  
    - null
 type: '@temp_bundle_type'       
 field_text:
 - plugin: sub_process
   source: field_text
   process:
     value: value
     format:
       plugin: default_value
       default_value: basic_html
   revision_id: revision_id
 - plugin: debug
   label: 'Step 1: Value received from the sub_process plugin: '   
 field_quote_author:
 - plugin: sub_process
   source: field_quote_author
   process:
     value: value
   revision_id: revision_id
 - plugin: debug
   label: 'Step 2: Value received from the sub_process plugin: '      
destination:
 plugin: 'entity_reference_revisions:paragraph'
 #default_bundle: text
migration_dependencies:
 required: {  }
 optional: {  }
miststudent2011 avatar
fr flag
I didnt understand completely what your question is here is an example for paragraph migration yml with multiple fields. https://drupal.stackexchange.com/a/304157/
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.