diff -u b/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php --- b/core/modules/migrate/src/MigrateExecutable.php +++ b/core/modules/migrate/src/MigrateExecutable.php @@ -369,13 +369,14 @@ $source = \Drupal::service('plugin.manager.migrate.source')->createInstance($source_config['plugin'], $source_config, $this->migration); // Rollback any rows that are not part of what we get from the source // plugin. + $source_ids = $source->sourceIds(); foreach ($id_map as $map_row) { $source_key = $id_map->currentSource(); $destination_key = $id_map->currentDestination(); // If this one wasn't imported, or if we're still receiving it from the // source plugin, then we don't need to do anything. - if (!$destination_key || !$source_key || $source->sourceIdsExists($source_key)) { + if (!$destination_key || !$source_key || in_array($source_key, $source_ids)) { continue; } diff -u b/core/modules/migrate/src/Plugin/SyncableSourceInterface.php b/core/modules/migrate/src/Plugin/SyncableSourceInterface.php --- b/core/modules/migrate/src/Plugin/SyncableSourceInterface.php +++ b/core/modules/migrate/src/Plugin/SyncableSourceInterface.php @@ -13,10 +13,8 @@ - * Generator for the source idlist. + * Returns all source ids. * - * @param array $test_ids - * The ids to test against. - * - * @return bool - * True if the id exists in the current source. + * @return array + * Return the source id fields and their values. */ - public function sourceIdsExists(array $ids); -} \ No newline at end of file + public function sourceIds(); + +} diff -u b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php --- b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php @@ -622,15 +622,12 @@ /** * {@inheritdoc} */ - public function sourceIdsExists(array $test_ids) { - $exists = FALSE; + public function sourceIds() { + $ids = []; foreach ($this->idList() as $source_ids) { - if ($source_ids == $test_ids) { - $exists = TRUE; - break; - } + $ids[] = $source_ids; } - return $exists; + return $ids; } /**