Submitted by Alexis94 on
Bonsoir tout le monde
J'utilise le module migrate source csv pour importer un fichier csv.
J'ai jeté un coup d'oeil à la page https://www.drupal.org/docs/8/modules/migrate-source-csv/using-the-migra... pour comprendre comment utiliser le module
Voici mon fichier csv:
id,title,body, field_image
1,title 1,some body text 1, image_from_the_web.jpg
2,title 2,some body text 2, image_from_the_web.jpg
3,title 3,some body text 3, image_from_the_web.jpg
Et voici ma configuration:
id: basuuid
label: Import articles
migration_groups:
- ACME import
source:
plugin: csv
# Full path to the file.
path: '/mypath/to/file/acme_articles.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
keys:
- id
# Here we identify the columns of interest in the source file.
# Each numeric key is the 0-based index of the column.
# For each column, the key below is the field name assigned to
# the data on import, to be used in field mappings below.
# The value is a user-friendly string for display by the
# migration UI.
column_names:
0:
id: 'Unique Id'
1:
title: 'Title'
2:
body: 'Post body'
3:
field_image: 'Image'
process:
title: title
body: body
field_image: field_image
type:
plugin: default_value
default_value: article
destination:
plugin: entity:node
Quand je veux exécuter la commande drush migrate-import basuuid, j'obtiens cette erreur:
Call to a member function getFileUri() on a non-object in /drupal/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
.
J'ai jeté un coup d'oeil sur d'autres forums pour voir si je pouvais résoudre le problème mais sans succès. Si quelqu’un a une solution, je lui en serai très reconnaissant
Merci