diff -u b/core/modules/migrate/src/Entity/Migration.php b/core/modules/migrate/src/Entity/Migration.php --- b/core/modules/migrate/src/Entity/Migration.php +++ b/core/modules/migrate/src/Entity/Migration.php @@ -446,15 +446,15 @@ /** * {@inheritdoc} */ - public function setMigrationResult($result) { - \Drupal::keyValue('migrate_result')->set($this->id(), $result); + public function getInterruptionResult() { + return \Drupal::keyValue('migrate_interruption_result')->get($this->id(), static::RESULT_INCOMPLETE); } /** * {@inheritdoc} */ - public function getMigrationResult() { - return \Drupal::keyValue('migrate_result')->get($this->id(), static::RESULT_INCOMPLETE); + public function clearInterruptionResult() { + \Drupal::keyValue('migrate_interruption_result')->delete($this->id()); } /** @@ -462,7 +462,7 @@ */ public function interruptMigration($result) { $this->setStatus(MigrationInterface::STATUS_STOPPING); - $this->setMigrationResult($result); + \Drupal::keyValue('migrate_interruption_result')->set($this->id(), $result); } /** @@ -477,7 +477,7 @@ } $processed_count = $this->getIdMap()->processedCount(); // We don't use == because in some circumstances (like unresolved stubs - // being created, the processed count may be higher than the available + // being created), the processed count may be higher than the available // source rows. return $source_count <= $processed_count; } diff -u b/core/modules/migrate/src/Entity/MigrationInterface.php b/core/modules/migrate/src/Entity/MigrationInterface.php --- b/core/modules/migrate/src/Entity/MigrationInterface.php +++ b/core/modules/migrate/src/Entity/MigrationInterface.php @@ -191,20 +191,17 @@ public function getStatusLabel(); /** - * Set the migration result. + * Get the result to return upon interruption. * - * @param int $result - * One of the RESULT_* constants. + * @return int + * The current interruption result. Defaults to RESULT_INCOMPLETE. */ - public function setMigrationResult($result); + public function getInterruptionResult(); /** - * Get the current migration result. - * - * @return int - * The current migration result. Defaults to RESULT_INCOMPLETE. + * Clears the result to return upon interruption. */ - public function getMigrationResult(); + public function clearInterruptionResult(); /** * Signal that the migration should be interrupted with the specified result only in patch2: unchanged: --- a/core/modules/migrate/src/MigrateExecutable.php +++ b/core/modules/migrate/src/MigrateExecutable.php @@ -290,7 +290,8 @@ public function import() { // If anyone has requested we stop, return the requested result. if ($this->migration->getStatus() == MigrationInterface::STATUS_STOPPING) { - $return = $this->migration->getMigrationResult(); + $return = $this->migration->getInterruptionResult(); + $this->migration->clearInterruptionResult(); break; } @@ -306,7 +307,6 @@ public function import() { } } - $this->migration->setMigrationResult($return); $this->getEventDispatcher()->dispatch(MigrateEvents::POST_IMPORT, new MigrateImportEvent($this->migration)); $this->migration->setStatus(MigrationInterface::STATUS_IDLE); return $return; only in patch2: unchanged: --- a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTestBase.php +++ b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTestBase.php @@ -73,9 +73,6 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_node_settings'); - $migration->setMigrationResult(MigrationInterface::RESULT_COMPLETED); - // Create a test node. $node = entity_create('node', array( 'type' => 'story',