diff --git a/core/modules/file/src/Plugin/migrate/process/d6/FileSource.php b/core/modules/file/src/Plugin/migrate/process/d6/FileSource.php index 56bb07f..d277e4e 100644 --- a/core/modules/file/src/Plugin/migrate/process/d6/FileSource.php +++ b/core/modules/file/src/Plugin/migrate/process/d6/FileSource.php @@ -20,11 +20,13 @@ class FileSource extends ProcessPluginBase { */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { list($source_base_path, $filepath) = $value; - // If filepath is absolute, it overrides. - if (!empty($filepath) && $filepath[0] === '/') { + + if (empty($source_base_path)) { return $filepath; } - return $source = $source_base_path . '/' . $filepath; + + $source_base_path = rtrim($source_base_path, '/'); + return $source_base_path . '/' . $filepath; } } diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php b/core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php index 14f77ed..28b1f10 100644 --- a/core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php +++ b/core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php @@ -28,7 +28,7 @@ protected function processMigration($migration) { // Make sure we have a single trailing slash. $source = $migration->getSourceConfiguration(); $source['site_path'] = 'core/modules/simpletest'; - $source['constants']['source_base_path'] = $this->root; + $source['constants']['source_base_path'] = ''; $migration->set('source', $source); } }