From d7e81b4703d7943a881ad86e5d0d4f7b75b3c8a2 Mon Sep 17 00:00:00 2001 From: David Valdez Date: Fri, 30 Aug 2019 12:54:44 -0500 Subject: [PATCH] Now the files migration does not die when a file is missing. It now just ignore that file and continue with the rest. --- .../migrations/upgrade_d7_file.yml | 6 +-- .../src/Plugin/migrate/process/FileExists.php | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 web/modules/custom/geo_upgrade/src/Plugin/migrate/process/FileExists.php diff --git a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_file.yml b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_file.yml index 48aa06c..ebe6579 100644 --- a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_file.yml +++ b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_file.yml @@ -9,7 +9,7 @@ source: plugin: d7_file scheme: public constants: - source_base_path: '/var/www/html/d7/' + source_base_path: '../d7/' process: fid: - @@ -29,11 +29,11 @@ process: - plugin: urlencode uri: - - - plugin: file_copy + - plugin: geo_file_exists source: - '@source_full_path' - uri + - plugin: file_copy filemime: - plugin: get diff --git a/web/modules/custom/geo_upgrade/src/Plugin/migrate/process/FileExists.php b/web/modules/custom/geo_upgrade/src/Plugin/migrate/process/FileExists.php new file mode 100644 index 0000000..e19983e --- /dev/null +++ b/web/modules/custom/geo_upgrade/src/Plugin/migrate/process/FileExists.php @@ -0,0 +1,39 @@ +