Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / migrate_plus / src / Plugin / migrate_plus / data_parser / Json.php
index df9b3fca8f2d099b7a3c8d44dc2a86f3ef245e78..c1220bc5f4e60d9836fbdaac4cabce4947e70d4f 100755 (executable)
@@ -15,13 +15,6 @@ use Drupal\migrate_plus\DataParserPluginBase;
  */
 class Json extends DataParserPluginBase implements ContainerFactoryPluginInterface {
 
-  /**
-   * The request headers passed to the data fetcher.
-   *
-   * @var array
-   */
-  protected $headers = [];
-
   /**
    * Iterator over the JSON data.
    *
@@ -119,7 +112,12 @@ class Json extends DataParserPluginBase implements ContainerFactoryPluginInterfa
         $field_data = $current;
         $field_selectors = explode('/', trim($selector, '/'));
         foreach ($field_selectors as $field_selector) {
-          $field_data = $field_data[$field_selector];
+          if (is_array($field_data) && array_key_exists($field_selector, $field_data)) {
+            $field_data = $field_data[$field_selector];
+               }
+               else {
+            $field_data = '';
+          }
         }
         $this->currentItem[$field_name] = $field_data;
       }