diff --git a/src/Util/MigrationRollbackBatch.php b/src/Util/MigrationRollbackBatch.php index b1f6890..67fed28 100644 --- a/src/Util/MigrationRollbackBatch.php +++ b/src/Util/MigrationRollbackBatch.php @@ -30,6 +30,11 @@ class MigrationRollbackBatch extends MigrateExecutable { */ protected QueueInterface $queue; + /** + * Flag if we should exclusively consider failed and ignored rows to rollback. + * + * @var bool + */ protected bool $checkStatus; /** @@ -48,7 +53,7 @@ public function __construct( array $options, ) { parent::__construct($migration, $messenger, $options); - $this->checkStatus = $options['checkStatus'] ?? FALSE; + $this->checkStatus = (bool) ($options['checkStatus'] ?? FALSE); } /** @@ -107,8 +112,9 @@ private function enqueue(): int { $iterator = $this->checkStatus ? new StatusFilter($id_map, StatusFilter::mapStatuses('failed,ignored')) : $id_map; - foreach ($iterator as $_) { + foreach ($iterator as $row) { $this->queue->createItem([ + 'iterator_value' => $row, 'destination' => $id_map->currentDestination(), 'source' => $id_map->currentSource(), ]);