From 30cfcd03d05e6511e2438e11b87a67ad5abcf2e7 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Fri, 30 Nov 2018 09:48:15 +0000 Subject: [PATCH] Issue #3017119 by phenaproxima: SourcePluginBase::next() calls Row constructor incorrectly --- .../migrate/src/Plugin/migrate/source/SourcePluginBase.php | 2 +- .../migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php index 3dd7144b8fc..8267bac7835 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php @@ -353,7 +353,7 @@ abstract class SourcePluginBase extends PluginBase implements MigrateSourceInter $row_data = $this->getIterator()->current() + $this->configuration; $this->fetchNextRow(); - $row = new Row($row_data, $this->migration->getSourcePlugin()->getIds(), $this->migration->getDestinationIds()); + $row = new Row($row_data, $this->getIds()); // Populate the source key for this row. $this->currentSourceIds = $row->getSourceIdValues(); diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php index 019ac42ab9e..7be474e014e 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php @@ -45,6 +45,11 @@ class MigrateEmbeddedDataTest extends KernelTestBase { $results = []; /** @var \Drupal\migrate\Row $row */ foreach ($source as $row) { + // The plugin should not mark any rows as stubs. We need to use + // assertSame() here because assertFalse() will pass falsy values (e.g., + // empty arrays). + $this->assertSame(FALSE, $row->isStub()); + $data_row = $row->getSource(); // The "data" row returned by getSource() also includes all source // configuration - we remove it so we see only the data itself.