1

I'm trying to import content from a csv source file, the csv file contains a field of image URL, and I'm trying to import that image using contrib modules migrate_plus, migrate_source_csv, migrate_tools.

Here is my configuration YAML file:

id: my_csv_import
label: Import test
migration_groups:
  - ACME import

source:
  plugin: csv
  # Full path to the file.
  path: 'news.csv'
  # Column delimiter. Comma (,) by default.
  delimiter: ','
  # Field enclosure. Double quotation marks (") by default.
  enclosure: '"'
  # The number of rows at the beginning which are not data.
  header_row_count: 1
  # The column(s) to use as a key. Each column specified will 
  # create an index in the migration table and too many columns 
  # may throw an index size error.
  keys:
    - Title

  constants:
    file_destination: 'public://images/'

process:
  title: Titre
  field_image:
    plugin: image_import
    source: Image
    destination: 'constants/file_destination'
    title: file_title
    alt: !title
  type:
    plugin: default_value
    default_value: posts

destination:
  plugin: entity:node

CSV file:

Titre,Image
title 1, http://my_domaine.com/images/image1.jpg
title 2, http://my_domaine.com/images/image2.jpg

Question: While executing the command line drush mim my_csv_import drush return the following error message:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "image_import" plugin does not exist. in                                        [error]
/Users/brahim/void/Sites/news8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52

Any help is appreciated!

1 Answer 1

2

Solved by installing and enabling the contrib module migrate_file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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