Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate / src / MigrateExecutable.php
index e8316e4129a079f487d6b56faf772eb0134b9291..01f33c285fd8aff7c055c08ac4c51e600791c6c0 100644 (file)
@@ -96,7 +96,7 @@ class MigrateExecutable implements MigrateExecutableInterface {
    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
    *   The migration to run.
    * @param \Drupal\migrate\MigrateMessageInterface $message
-   *   The message to record.
+   *   The migrate message service.
    * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
    *   The event dispatcher.
    *
@@ -386,9 +386,14 @@ class MigrateExecutable implements MigrateExecutableInterface {
           $multiple = $plugin->multiple();
         }
       }
-      // No plugins or no value means do not set.
-      if ($plugins && !is_null($value)) {
-        $row->setDestinationProperty($destination, $value);
+      // Ensure all values, including nulls, are migrated.
+      if ($plugins) {
+        if (isset($value)) {
+          $row->setDestinationProperty($destination, $value);
+        }
+        else {
+          $row->setEmptyDestinationProperty($destination);
+        }
       }
       // Reset the value.
       $value = NULL;
@@ -534,6 +539,9 @@ class MigrateExecutable implements MigrateExecutableInterface {
 
     // @TODO: explore resetting the container.
 
+    // Run garbage collector to further reduce memory.
+    gc_collect_cycles();
+
     return memory_get_usage();
   }