Issue #2959097 by Jo Fitzgerald, rakesh.gectcr, quietone, heddn: Log message if migration plugin skip the row When there is no destination found.
parent
bbac45a7ba
commit
b2f170c55f
|
@ -410,7 +410,7 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
|
|||
*/
|
||||
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 @@ namespace Drupal\Tests\migrate\Kernel\Plugin;
|
|||
|
||||
use Drupal\KernelTests\KernelTestBase;
|
||||
use Drupal\migrate\MigrateException;
|
||||
use Drupal\migrate\MigrateSkipRowException;
|
||||
|
||||
/**
|
||||
* Tests the migration plugin.
|
||||
|
@ -115,4 +116,15 @@ class MigrationTest extends KernelTestBase {
|
|||
$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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue