diff --git a/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php b/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php index c68fe34..2ce5009 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php +++ b/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php @@ -96,17 +96,17 @@ public function transform($value, MigrateExecutableInterface $migrate_executable } list($source, $destination) = $value; + // Ensure the source file exists. + if (!file_exists($source)) { + throw new MigrateException("File '$source' does not exist"); + } + // If the source path or URI represents a remote resource, delegate to the // download plugin. if (!$this->isLocalUri($source)) { return $this->downloadPlugin->transform($value, $migrate_executable, $row, $destination_property); } - // Ensure the source file exists, if it's a local URI or path. - if (!file_exists($source)) { - throw new MigrateException("File '$source' does not exist"); - } - // If the start and end file is exactly the same, there is nothing to do. if ($this->isLocationUnchanged($source, $destination)) { return $destination;