1

I'm importing media files which have a taxonomy in the media content type definition.

Here is the section of my Yaml file that deals with the taxonomy.

field_nih_asset_taxonomy_auto:
    -
      plugin: skip_on_empty
      method: process
      source: nihtaxonomy
    -
      plugin: hierarchical_taxonomy
      bundle: nih_asset_taxonomy_auto
      ignore_case: true
      source:
        - t1
        - t2
        - t3
        - t4
        - t5
        - t6      
    -
      plugin: explode
      delimiter: /

The second plugin 'hierarchictal_taxonomy' comes from the Migrate Hierarchictal Taxonomy module.

My source file is a json file and here are the mappings for the two plugin sources from above.

"nihtaxonomy": "ntp-db/ntp_reports/ntp_pathology_tbls/99020_tables",
"t1": "ntp-db",
"t2": "ntp_reports",
"t3": "ntp_pathology_tbls",
"t4": "99020_tables",
"t5": "",
"t6": ""

What I'm expecting to happen is the import reads from the 'nihtaxonomy' source, explodes that, and assigns all of those terms as taxonomies.

Then, I'm expecting the hierarchical taxonomy plugin to create the parent child relationships. (there are no more than 6 terms, but it varies per record, if that matters).

This is working correctly. The problem is that the only term that's being assigned to the entity is the last child, so 99020_tables in this example. But I need all of the terms attached.

How do I need to configure my Yaml file so all the terms get attached to the node?

Your Answer

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

Browse other questions tagged or ask your own question.