Commit 533b9483 authored by catch's avatar catch
Browse files

Issue #3339373 by alexpott, andypost, mondrake:...

Issue #3339373 by alexpott, andypost, mondrake: Drupal\migrate\Plugin\migrate\source\SourcePluginBase::rewind() is rewinding database statements

(cherry picked from commit 1a9665ac)
parent 4ee7b62c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -376,6 +376,16 @@ protected function fetchNextBatch() {
    $this->getIterator()->rewind();
  }

  /**
   * {@inheritdoc}
   */
  public function rewind(): void {
    $this->batch = 0;
    // Database queries have to be run again as they cannot be rewound.
    unset($this->iterator);
    parent::rewind();
  }

  /**
   * @return \Drupal\Core\Database\Query\SelectInterface
   */
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ label: Track changes test.
source:
  plugin: track_changes_test
  track_changes: true
  batch_size: 1
destination:
  plugin: entity:taxonomy_term
migration_tags:
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ public function testTrackChanges() {
      ->execute();

    // Execute migration again.
    $this->executeMigration('track_changes_test');
    $this->executeMigration($this->migration);

    // Check that the all the hashes except for 'Item 2'and 'Item 4' have
    // changed.