Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
c1cf341b
Commit
c1cf341b
authored
Apr 06, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2222169
by David Hernández: Add skip_row option to StaticMap.
parent
9de62afc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/StaticMap.php
...e/lib/Drupal/migrate/Plugin/migrate/process/StaticMap.php
+2
-1
core/modules/migrate/tests/Drupal/migrate/Tests/process/StaticMapTest.php
...rate/tests/Drupal/migrate/Tests/process/StaticMapTest.php
+1
-1
No files found.
core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/StaticMap.php
View file @
c1cf341b
...
...
@@ -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
Migrate
Exception
(
sprintf
(
'Lookup of %s failed.'
,
var_export
(
$value
,
TRUE
))
);
throw
new
Migrate
SkipRowException
(
);
}
else
{
return
$value
;
...
...
core/modules/migrate/tests/Drupal/migrate/Tests/process/StaticMapTest.php
View file @
c1cf341b
...
...
@@ -68,7 +68,7 @@ public function testMapwithEmptySource() {
/**
* Tests when the source is invalid.
*
* @expectedException \Drupal\migrate\MigrateException
* @expectedException \Drupal\migrate\Migrate
SkipRow
Exception
*/
public
function
testMapwithInvalidSource
()
{
$this
->
plugin
->
transform
(
array
(
'bar'
),
$this
->
migrateExecutable
,
$this
->
row
,
'destinationproperty'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment