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

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

parent 9de62afc
No related branches found
No related tags found
No related merge requests found
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment