Trying to migrate images by copying them from an external source:
id: custom_news_migration_with_external_images_1
label: custom news migration with external images importer
source:
plugin: embedded_data
ids:
id:
type: integer
constants: file_destination: /home/ip/c921/web/sites/default/files/images #absolute path ... default 'public://images'
process:
nid: id
title: title
field_news_image:
plugin: image_import
source: file
destination: 'constants/file_destination'
title: file_title
alt: title
destination:
plugin: entity:node
default_bundle: news
The error I continually get in the console is:
[error] ... Passed variable is not an array or object in /home/ip/c921/web/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php Zeile 96
Code snippet:
92 /**
93 * {@inheritdoc}
94 */
95 public function initializeIterator() {
96 return new \ArrayIterator($this->dataRows);
97 }
Forgot to mention that the drupal.org example has data_rows entries:
data_rows:
-
id: 1
title: 'Page 1 title'
file: 'https://www.drupal.org/files/druplicon-small.png'
file_title: 'Druplicon logo'
-
id: 2
title: 'Page 2 title'
file: 'https://www.drupal.org/files/drupal_logo-blue.png'
file_title: 'Drupal logo'
I didn't use them. Because I want to migrate thousends of images.
The basic example is from drupal.org
Help would be great.