From 9f7321168e1661c6b55d12e263c38d115c9f6dee Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 17 Aug 2015 22:55:16 -0400 Subject: [PATCH] Issue #2549003 follow-up by phenaproxima: Fix regression in Migrate Upgrade. --- .../src/Plugin/migrate/builder/d6/ProfileValues.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/modules/user/src/Plugin/migrate/builder/d6/ProfileValues.php b/core/modules/user/src/Plugin/migrate/builder/d6/ProfileValues.php index af0b39cd1e2..937772bc899 100644 --- a/core/modules/user/src/Plugin/migrate/builder/d6/ProfileValues.php +++ b/core/modules/user/src/Plugin/migrate/builder/d6/ProfileValues.php @@ -8,6 +8,7 @@ namespace Drupal\user\Plugin\migrate\builder\d6; use Drupal\migrate\Entity\Migration; +use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\Plugin\migrate\builder\BuilderBase; /** @@ -21,7 +22,17 @@ class ProfileValues extends BuilderBase { public function buildMigrations(array $template) { $migration = Migration::create($template); - foreach ($this->getSourcePlugin('d6_profile_field') as $field) { + // @TODO The source plugin should accept a database connection. + // @see https://www.drupal.org/node/2552791 + $source_plugin = $this->getSourcePlugin('d6_profile_field', $template['source']); + try { + $source_plugin->checkRequirements(); + } + catch (RequirementsException $e) { + return []; + } + + foreach ($source_plugin as $field) { $migration->setProcessOfProperty($field->getSourceProperty('name'), $field->getSourceProperty('name')); }