diff core/modules/user/src/Plugin/migrate/ProfileValues.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
line wrap: on
line diff
--- a/core/modules/user/src/Plugin/migrate/ProfileValues.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/modules/user/src/Plugin/migrate/ProfileValues.php	Thu Feb 28 13:21:36 2019 +0000
@@ -4,7 +4,6 @@
 
 use Drupal\migrate\Exception\RequirementsException;
 use Drupal\migrate\MigrateExecutable;
-use Drupal\migrate\MigrateSkipRowException;
 use Drupal\migrate\Plugin\Migration;
 
 /**
@@ -32,6 +31,7 @@
       $definition['destination']['plugin'] = 'null';
       $definition['idMap']['plugin'] = 'null';
       try {
+        $this->checkRequirements();
         $profile_field_migration = $this->migrationPluginManager->createStubMigration($definition);
         $migrate_executable = new MigrateExecutable($profile_field_migration);
         $source_plugin = $profile_field_migration->getSourcePlugin();
@@ -45,6 +45,7 @@
             [
               'migration' => 'user_profile_field',
               'source_ids' => $fid,
+              'no_stub' => TRUE,
             ];
           $plugin = $this->processPluginManager->createInstance('migration_lookup', $configuration, $profile_field_migration);
           $new_value = $plugin->transform($fid, $migrate_executable, $row, 'tmp');
@@ -52,14 +53,12 @@
             // Set the destination to the migrated profile field name.
             $this->process[$new_value[1]] = $name;
           }
-          else {
-            throw new MigrateSkipRowException("Can't migrate source field $name.");
-          }
         }
       }
       catch (RequirementsException $e) {
         // The checkRequirements() call will fail when the profile module does
-        // not exist on the source site.
+        // not exist on the source site, or if the required migrations have not
+        // yet run.
       }
     }
     return parent::getProcess();