Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / field / src / Plugin / migrate / source / d7 / Field.php
index 9e92619f8e7819c9f7678821b159481405e8d24f..ea3bf66d3863a3801cfe0584d519361ca60a7b48 100644 (file)
@@ -15,7 +15,7 @@ use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
  *
  * @MigrateSource(
  *   id = "d7_field",
- *   source_module = "field"
+ *   source_module = "field_sql_storage"
  * )
  */
 class Field extends DrupalSqlBase {
@@ -34,6 +34,19 @@ class Field extends DrupalSqlBase {
       ->condition('fci.deleted', 0);
     $query->join('field_config_instance', 'fci', 'fc.id = fci.field_id');
 
+    // If the Drupal 7 Title module is enabled, we don't want to migrate the
+    // fields it provides. The values of those fields will be migrated to the
+    // base fields they were replacing.
+    if ($this->moduleExists('title')) {
+      $title_fields = [
+        'title_field',
+        'name_field',
+        'description_field',
+        'subject_field',
+      ];
+      $query->condition('fc.field_name', $title_fields, 'NOT IN');
+    }
+
     return $query;
   }