0

I'm trying to write a D8 migrations files but the following one isn't working on the source 'body/value' because it resolves to a null value instead of the intended string.

id: my_d7_node_news
label: 'Nodes (News)'
langcode: en
status: true
dependencies: {  }
class: Drupal\migrate\Plugin\Migration
field_plugin_method: null
cck_plugin_method: null
migration_tags:
  - 'Drupal 7'
source:
  plugin: d7_node
  node_type: news
process:
  nid: tnid
  vid: vid
  title: title
  uid: node_uid
  status: status
  created: created
  changed: changed
  revision_uid: revision_uid
  revision_log: log
  revision_timestamp: timestamp
  'body/value':
    plugin: get
    source: 'body/value'
  'body/summary':
    plugin: default_value
    default_value: some summary
  'body/format':
    plugin: default_value
    default_value: rich_text
destination:
  plugin: 'entity:node'
  default_bundle: news

I tried multiple writing for the source: 'body/value' (e,g: source: body_value, etc, ...) with no luck...

Which syntax should I use to make successful mapping on body/value: body/value using the d7_node source plugin?

0

Something like this:

  body:
    plugin: iterator
    source: body
    process:
      value: value
      format:
        plugin: default_value
        default_value: filtered_html
-1

Just use 'body', as in:

body: body

That is what core d7_node migration does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.