Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / text / src / Plugin / migrate / cckfield / TextField.php
index 1d18b30792084954bd29c0044a22b341ebc7641d..d3558a71724c7b536187035dbd2362d11cfab749 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace Drupal\text\Plugin\migrate\cckfield;
 
+@trigger_error('TextField is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\text\Plugin\migrate\field\d6\TextField or \Drupal\text\Plugin\migrate\field\d7\TextField instead.', E_USER_DEPRECATED);
+
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\Row;
 use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
@@ -16,6 +18,12 @@ use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
  *   },
  *   core = {6,7}
  * )
+ *
+ * @deprecated in Drupal 8.3.x, to be removed before Drupal 9.0.x. Use
+ * \Drupal\text\Plugin\migrate\field\d6\TextField or
+ * \Drupal\text\Plugin\migrate\field\d7\TextField instead.
+ *
+ * @see https://www.drupal.org/node/2751897
  */
 class TextField extends CckFieldPluginBase {
 
@@ -43,7 +51,9 @@ class TextField extends CckFieldPluginBase {
    * {@inheritdoc}
    */
   public function processCckFieldValues(MigrationInterface $migration, $field_name, $field_info) {
-    if ($field_info['widget_type'] == 'optionwidgets_onoff') {
+    $widget_type = isset($field_info['widget_type']) ? $field_info['widget_type'] : $field_info['widget']['type'];
+
+    if ($widget_type == 'optionwidgets_onoff') {
       $process = [
         'value' => [
           'plugin' => 'static_map',
@@ -88,7 +98,7 @@ class TextField extends CckFieldPluginBase {
     }
 
     $process = [
-      'plugin' => 'iterator',
+      'plugin' => 'sub_process',
       'source' => $field_name,
       'process' => $process,
     ];