Issue with creating nodes from CSV using Migrate Plus module

Created on 1 April 2024, 3 months ago
Updated 16 April 2024, 2 months ago

Problem/Motivation

I am encountering an issue while attempting to create nodes from a CSV file using the Migrate Plus module in Drupal 10.2. The nodes are successfully created with most fields populated from the CSV, but I am facing an error specifically related to a taxonomy reference field named 'field_product_materials'. This field is configured to reference the 'Materials' vocabulary (machine name: materials). But when I check Terms in the vocabulary the first term in csv 'Material 1' is created. SO only the issue seems to be term attaching to node.

Steps to reproduce

1. Import nodes from a CSV file using the Migrate Plus module.
2. Observe the error related to the taxonomy reference field 'field_product_materials'.

CSV

ArticleNumber,ArticleName,SizeFilter,SizeAttribute,Material,Specifications
RAND001,Artical Name 1,DFS1,4.6,Material1,"Some HTML Content 1"
RAND002,Artical Name 2,DFS2,4.5,Material2,"Some HTML Content 2"
RAND003,Artical Name 3,DFS1,4.6,Material3,"Some HTML Content 3"
RAND004,Artical Name 4,DFS1,4.6,Material4,"Some HTML Content 4"

Configuration

langcode: en
status: true
dependencies: {  }
id: product_kits
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: products
label: 'Import product Kits'
source:
  plugin: csv
  path: /home/data/data.csv
  delimiter: ','
  enclosure: '"'
  header_row_count: 1
  ids:
    - ArticleNumber

process:
  title: ArticleName
  field_migration_unique_id: ArticleNumber
  field_size_attribute: SizeAttribute
  field_size_filter: SizeFilter
  body:
    -
      plugin: callback
      callable: utf8_encode
      source: Specifications
  field_product_materials:
    -
      plugin: skip_on_empty
      method: process
      source: Material
    -
      plugin: entity_generate
      entity_type: taxonomy_term
      bundle: materials  #VOCABULARY_MACHINE_NAME
      value_key: name
      bundle_key: vid

destination:
  plugin: 'entity:node'
  default_bundle: product_kit

migration_dependencies: null
💬 Support request
Status

Fixed

Version

6.0

Component

Plugins

Created by

🇮🇳India mdeahmad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024