Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
4cc0d6d4
Commit
4cc0d6d4
authored
Sep 01, 2015
by
webchick
Browse files
Issue
#2560671
by phenaproxima, neclimdul: The Migration process plugin should not skip rows
parent
7f3d4132
Changes
5
Hide whitespace changes
Inline
Side-by-side
core/modules/field/migration_templates/d6_field_formatter_settings.yml
View file @
4cc0d6d4
...
...
@@ -20,13 +20,13 @@ process:
migration
:
d6_field
source
:
-
field_name
-
plugin
:
skip_on_empty
method
:
row
-
plugin
:
extract
index
:
-
1
-
plugin
:
skip_on_empty
method
:
row
entity_type
:
'
constants/entity_type'
bundle
:
type_name
view_mode
:
...
...
@@ -35,6 +35,9 @@ process:
migration
:
d6_view_modes
source
:
-
view_mode
-
plugin
:
skip_on_empty
method
:
row
-
plugin
:
extract
index
:
...
...
core/modules/migrate/src/Plugin/migrate/process/Migration.php
View file @
4cc0d6d4
...
...
@@ -11,7 +11,6 @@
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\migrate\MigrateSkipProcessException
;
use
Drupal\migrate\MigrateSkipRowException
;
use
Drupal\migrate\Plugin\MigratePluginManager
;
use
Drupal\migrate\ProcessPluginBase
;
use
Drupal\migrate\Entity\MigrationInterface
;
...
...
@@ -145,7 +144,6 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
return
$destination_ids
;
}
}
throw
new
MigrateSkipRowException
();
}
/**
...
...
core/modules/migrate/tests/src/Unit/process/MigrationTest.php
deleted
100644 → 0
View file @
7f3d4132
<?php
/**
* @file
* Contains \Drupal\Tests\migrate\Unit\process\MigrationTest.
*/
namespace
Drupal\Tests\migrate\Unit\process
;
use
Drupal\migrate\MigrateException
;
use
Drupal\migrate\Plugin\migrate\process\Migration
;
/**
* Tests the migration process plugin.
*
* @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Migration
* @group migrate
*/
class
MigrationTest
extends
MigrateProcessTestCase
{
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
$this
->
migrationConfiguration
=
[
'id'
=>
'test'
,
'process'
=>
[],
'source'
=>
[],
];
parent
::
setUp
();
}
/**
* Assert that exceptions during import are logged.
* @expectedException \Drupal\migrate\MigrateSkipRowException
* @covers ::transform
*/
public
function
testSaveOnException
()
{
// A bunch of mock objects to get thing working
$migration
=
$this
->
getMigration
();
$migration_source
=
$this
->
getMock
(
'\Drupal\migrate\Plugin\MigrateSourceInterface'
);
$migration_source
->
expects
(
$this
->
once
())
->
method
(
'getIds'
)
->
willReturn
([]);
$migration
->
expects
(
$this
->
once
())
->
method
(
'getSourcePlugin'
)
->
willReturn
(
$migration_source
);
$migration_destination
=
$this
->
getMock
(
'\Drupal\migrate\Plugin\MigrateDestinationInterface'
);
$migration
->
expects
(
$this
->
once
())
->
method
(
'getDestinationPlugin'
)
->
willReturn
(
$migration_destination
);
$storage
=
$this
->
getMock
(
'\Drupal\Core\Entity\EntityStorageInterface'
);
$storage
->
expects
(
$this
->
once
())
->
method
(
'loadMultiple'
)
->
willReturn
([
'id'
=>
$migration
]);
$manager
=
$this
->
getMockBuilder
(
'\Drupal\migrate\Plugin\MigratePluginManager'
)
->
disableOriginalConstructor
()
->
getMock
();
// Throw an exception during import so we can log it.
$migration_destination
->
expects
(
$this
->
once
())
->
method
(
'import'
)
->
willThrowException
(
new
MigrateException
());
// Build our migration plugin.
$plugin
=
new
Migration
([
'migration'
=>
[]],
'migration'
,
// ?
[],
$migration
,
$storage
,
$manager
);
// Assert that we log exceptions thrown during the import.
$this
->
migrateExecutable
->
expects
(
$this
->
once
())
->
method
(
'saveMessage'
);
$plugin
->
transform
(
'value'
,
$this
->
migrateExecutable
,
$this
->
row
,
'prop'
);
}
}
core/modules/taxonomy/migration_templates/d6_vocabulary_field.yml
View file @
4cc0d6d4
...
...
@@ -13,9 +13,13 @@ process:
entity_type
:
'
constants/entity_type'
type
:
'
constants/type'
field_name
:
plugin
:
migration
migration
:
d6_taxonomy_vocabulary
source
:
vid
-
plugin
:
migration
migration
:
d6_taxonomy_vocabulary
source
:
vid
-
plugin
:
skip_on_empty
method
:
row
'
settings/target_type'
:
'
constants/target_entity_type'
cardinality
:
'
constants/cardinality'
destination
:
...
...
core/modules/taxonomy/migration_templates/d6_vocabulary_field_instance.yml
View file @
4cc0d6d4
...
...
@@ -12,9 +12,13 @@ process:
entity_type
:
'
constants/entity_type'
bundle
:
type
field_name
:
plugin
:
migration
migration
:
d6_taxonomy_vocabulary
source
:
vid
-
plugin
:
migration
migration
:
d6_taxonomy_vocabulary
source
:
vid
-
plugin
:
skip_on_empty
method
:
row
'
settings/handler'
:
'
constants/selection_handler'
'
settings/handler_settings/target_bundles/0'
:
@
field_name
'
settings/handler_settings/auto_create'
:
'
constants/auto_create'
...
...
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