0

I am trying to use 'migrate source csv' to migrate some content with taxonomy terms in drupal 8. If the field has only one term, I can use the following and it works out fineprocess: type: plugin: default_value default_value: adi title: title field_description: description body: note field_subject_terms: plugin: entity_generate source: subject_terms destination: plugin: 'entity:node'

However, if it has more than one term, and I try with the following code, I get an error about th term is not an integer. I have also tried adding the iterator plugin to the code below, but still the same error.process: type: plugin: default_value default_value: adi title: title field_description: description body: note field_subject_terms: plugin: explode source: subject_terms delimiter: ',' process: plugin: entity_generate destination: plugin: 'entity:node' migration_dependencies: null

Any help appreciated. Thanks

1

'process' is not recursive - you can't simply embed processing within another plugin in the general case (only iterator has that ability). Rather, plugins (generally) need to be executed in sequence:

field_subject_terms:
  # First step in the processing pipeline.
  -
    plugin: explode
    source: subject_terms
    delimiter: ','
  # Results of the first step are passed through to the second step.
  -
    plugin: entity_generate

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.