Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / field / src / Plugin / migrate / source / d7 / FieldInstancePerFormDisplay.php
index ac599ec0a517ebd7ba18d419a030be4634c6f857..7165f6d21e7fb454e3e159b53d49ed105a586fb8 100644 (file)
@@ -2,58 +2,15 @@
 
 namespace Drupal\field\Plugin\migrate\source\d7;
 
-use Drupal\migrate\Row;
-use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
-
 /**
  * The field instance per form display source class.
  *
  * @MigrateSource(
- *   id = "d7_field_instance_per_form_display"
+ *   id = "d7_field_instance_per_form_display",
+ *   source_module = "field"
  * )
  */
-class FieldInstancePerFormDisplay extends DrupalSqlBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function query() {
-    $query = $this->select('field_config_instance', 'fci')
-      ->fields('fci', [
-        'field_name',
-        'bundle',
-        'data',
-        'entity_type'
-      ])
-      ->fields('fc', [
-        'type',
-        'module',
-      ]);
-    $query->join('field_config', 'fc', 'fci.field_id = fc.id');
-    return $query;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function prepareRow(Row $row) {
-    $data = unserialize($row->getSourceProperty('data'));
-    $row->setSourceProperty('widget', $data['widget']);
-    $row->setSourceProperty('widget_settings', $data['widget']['settings']);
-    return parent::prepareRow($row);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function fields() {
-    return [
-      'field_name' => $this->t('The machine name of field.'),
-      'bundle' => $this->t('Content type where this field is used.'),
-      'data' => $this->t('Field configuration data.'),
-      'entity_type' => $this->t('The entity type.'),
-    ];
-  }
+class FieldInstancePerFormDisplay extends FieldInstance {
 
   /**
    * {@inheritdoc}