Commit c1cf341b authored by alexpott's avatar alexpott

Issue #2222169 by David Hernández: Add skip_row option to StaticMap.

parent 9de62afc
......@@ -12,6 +12,7 @@
use Drupal\migrate\MigrateException;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate\Row;
use Drupal\migrate\MigrateSkipRowException;
/**
* This plugin changes the current value based on a static lookup map.
......@@ -46,7 +47,7 @@ public function transform($value, MigrateExecutable $migrate_executable, Row $ro
return $this->configuration['default_value'];
}
if (empty($this->configuration['bypass'])) {
throw new MigrateException(sprintf('Lookup of %s failed.', var_export($value, TRUE)));
throw new MigrateSkipRowException();
}
else {
return $value;
......
......@@ -68,7 +68,7 @@ public function testMapwithEmptySource() {
/**
* Tests when the source is invalid.
*
* @expectedException \Drupal\migrate\MigrateException
* @expectedException \Drupal\migrate\MigrateSkipRowException
*/
public function testMapwithInvalidSource() {
$this->plugin->transform(array('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