Skip to content
Snippets Groups Projects
Unverified Commit b2f170c5 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2959097 by Jo Fitzgerald, rakesh.gectcr, quietone, heddn: Log message...

Issue #2959097 by Jo Fitzgerald, rakesh.gectcr, quietone, heddn: Log message if migration plugin skip the row When there is no destination found.
parent bbac45a7
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -410,7 +410,7 @@ protected function getProcessNormalized(array $process) {
*/
public function getDestinationPlugin($stub_being_requested = FALSE) {
if ($stub_being_requested && !empty($this->destination['no_stub'])) {
throw new MigrateSkipRowException();
throw new MigrateSkipRowException('Stub requested but not made because no_stub configuration is set.');
}
if (!isset($this->destinationPlugin)) {
$this->destinationPlugin = $this->destinationPluginManager->createInstance($this->destination['plugin'], $this->destination, $this);
......
......@@ -4,6 +4,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\migrate\MigrateException;
use Drupal\migrate\MigrateSkipRowException;
/**
* Tests the migration plugin.
......@@ -115,4 +116,15 @@ public function testGetTrackLastImported() {
$this->assertEquals(TRUE, $migration->isTrackLastImported());
}
/**
* Tests Migration::getDestinationPlugin()
*
* @covers ::getDestinationPlugin
*/
public function testGetDestinationPlugin() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration(['destination' => ['no_stub' => TRUE]]);
$this->setExpectedException(MigrateSkipRowException::class, "Stub requested but not made because no_stub configuration is set.");
$migration->getDestinationPlugin(TRUE);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment