diff --git a/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php index 03b26c5dc2..09a7fc6145 100644 --- a/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php +++ b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php @@ -115,7 +115,10 @@ public static function run($initial_ids, $config, &$context) { if ($definition['destination']['plugin'] === 'entity:file') { // Make sure we have a single trailing slash. $configuration['source']['constants']['source_base_path'] = rtrim($config['source_base_path'], '/') . '/'; - if ($definition['source']['scheme'] === 'private') { + // Use the private file path if the scheme property is set in the source + // plugin definition and is 'private'. + $scheme = $definition['source']['scheme'] ?? NULL; + if ($scheme === 'private') { $configuration['source']['constants']['source_base_path'] = rtrim($config['source_private_file_path'], '/') . '/'; } }