Unverified Commit 522631b0 authored by alexpott's avatar alexpott

Issue #2951715 by dravenk, marvil07, rakesh.gectcr, davidsonjames, heddn, Jo...

Issue #2951715 by dravenk, marvil07, rakesh.gectcr, davidsonjames, heddn, Jo Fitzgerald, quietone, alexpott, maxocub: Log message if static_map plugin skips the row
parent 68cd2e55
......@@ -3,6 +3,7 @@
namespace Drupal\migrate\Plugin\migrate\process;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Variable;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateException;
use Drupal\migrate\MigrateExecutableInterface;
......@@ -140,7 +141,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
return $this->configuration['default_value'];
}
if (empty($this->configuration['bypass'])) {
throw new MigrateSkipRowException();
throw new MigrateSkipRowException(sprintf("No static mapping found for '%s' and no default value provided for destination '%s'.", Variable::export($value), $destination_property));
}
else {
return $value;
......
......@@ -2,6 +2,7 @@
namespace Drupal\Tests\migrate\Unit\process;
use Drupal\Component\Utility\Variable;
use Drupal\migrate\MigrateException;
use Drupal\migrate\MigrateSkipRowException;
use Drupal\migrate\Plugin\migrate\process\StaticMap;
......@@ -50,7 +51,7 @@ public function testMapwithEmptySource() {
* Tests when the source is invalid.
*/
public function testMapwithInvalidSource() {
$this->setExpectedException(MigrateSkipRowException::class);
$this->setExpectedException(MigrateSkipRowException::class, sprintf("No static mapping found for '%s' and no default value provided for destination '%s'.", Variable::export(['bar']), 'destinationproperty'));
$this->plugin->transform(['bar'], $this->migrateExecutable, $this->row, 'destinationproperty');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment