Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
fcc5f3b2
Commit
fcc5f3b2
authored
May 12, 2014
by
Angie Byron
Browse files
Issue
#2263453
by chx, benjy: Split migration_dependencies into two keys.
parent
49b4f933
Changes
38
Hide whitespace changes
Inline
Side-by-side
core/modules/migrate/lib/Drupal/migrate/MigrationStorage.php
View file @
fcc5f3b2
...
...
@@ -20,34 +20,28 @@ class MigrationStorage extends ConfigEntityStorage implements MigrateBuildDepend
*/
public
function
buildDependencyMigration
(
array
$migrations
,
array
$dynamic_ids
)
{
// Migration dependencies defined in the migration storage can be
// soft dependencies: if a soft dependency does not run, the current
// migration is still OK to go. This is indicated by adding ": false"
// (without quotes) after the name of the dependency. Hard dependencies
// (default) are called requirements. Both hard and soft dependencies (if
// run at all) must run before the current one.
// optional or required. If an optional dependency does not run, the current
// migration is still OK to go. Both optional and required dependencies
// (if run at all) must run before the current migration.
$dependency_graph
=
array
();
$requirement_graph
=
array
();
$different
=
FALSE
;
foreach
(
$migrations
as
$migration
)
{
/** @var \Drupal\migrate\Entity\Migration
Interface
$migration */
/** @var \Drupal\migrate\Entity\Migration $migration */
$id
=
$migration
->
id
();
$requirements
[
$id
]
=
array
();
$dependency_graph
[
$id
][
'edges'
]
=
array
();
if
(
isset
(
$migration
->
migration_dependencies
)
&&
is_array
(
$migration
->
migration_dependencies
))
{
foreach
(
$migration
->
migration_dependencies
as
$dependency
)
{
if
(
is_string
(
$dependency
)
&&
!
isset
(
$dynamic_ids
[
$dependency
]))
{
if
(
isset
(
$migration
->
migration_dependencies
[
'required'
]
))
{
foreach
(
$migration
->
migration_dependencies
[
'required'
]
as
$dependency
)
{
if
(
!
isset
(
$dynamic_ids
[
$dependency
]))
{
$this
->
addDependency
(
$requirement_graph
,
$id
,
$dependency
,
$dynamic_ids
);
}
if
(
is_array
(
$dependency
))
{
list
(
$dependency_string
,
$required
)
=
each
(
$dependency
);
$dependency
=
$dependency_string
;
if
(
$required
)
{
$this
->
addDependency
(
$requirement_graph
,
$id
,
$dependency
,
$dynamic_ids
);
}
else
{
$different
=
TRUE
;
}
}
$this
->
addDependency
(
$dependency_graph
,
$id
,
$dependency
,
$dynamic_ids
);
}
}
if
(
isset
(
$migration
->
migration_dependencies
[
'optional'
]))
{
foreach
(
$migration
->
migration_dependencies
[
'optional'
]
as
$dependency
)
{
$different
=
TRUE
;
$this
->
addDependency
(
$dependency_graph
,
$id
,
$dependency
,
$dynamic_ids
);
}
}
...
...
core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityFile.php
View file @
fcc5f3b2
...
...
@@ -14,6 +14,9 @@
use
Drupal\migrate\Row
;
/**
* Every migration that uses this destination must have an optional
* dependency on the d6_file migration to ensure it runs first.
*
* @MigrateDestination(
* id = "entity:file"
* )
...
...
core/modules/migrate_drupal/config/install/migrate.migration.d6_aggregator_item.yml
View file @
fcc5f3b2
...
...
@@ -18,4 +18,5 @@ process:
destination
:
plugin
:
entity:aggregator_item
migration_dependencies
:
-
d6_aggregator_feed
required
:
-
d6_aggregator_feed
core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml
View file @
fcc5f3b2
...
...
@@ -58,5 +58,7 @@ process:
destination
:
plugin
:
entity:block
migration_dependencies
:
-
d6_custom_block
-
d6_menu
:
false
required
:
-
d6_custom_block
optional
:
-
d6_menu
core/modules/migrate_drupal/config/install/migrate.migration.d6_book.yml
View file @
fcc5f3b2
...
...
@@ -16,4 +16,5 @@ process:
destination
:
plugin
:
book
migration_dependencies
:
-
d6_node
required
:
-
d6_node
core/modules/migrate_drupal/config/install/migrate.migration.d6_cck_field_revision.yml
View file @
fcc5f3b2
...
...
@@ -10,5 +10,6 @@ process:
destination
:
plugin
:
entity_revision:node
migration_dependencies
:
-
d6_cck_field_values
-
d6_node_revision
required
:
-
d6_cck_field_values
-
d6_node_revision
core/modules/migrate_drupal/config/install/migrate.migration.d6_cck_field_values.yml
View file @
fcc5f3b2
...
...
@@ -13,6 +13,7 @@ process:
destination
:
plugin
:
entity:node
migration_dependencies
:
-
d6_node
-
d6_field_formatter_settings
-
d6_field_instance_widget_settings
required
:
-
d6_node
-
d6_field_formatter_settings
-
d6_field_instance_widget_settings
core/modules/migrate_drupal/config/install/migrate.migration.d6_comment.yml
View file @
fcc5f3b2
...
...
@@ -44,8 +44,9 @@ process:
destination
:
plugin
:
entity:comment
migration_dependencies
:
-
d6_node
-
d6_user
-
d6_comment_entity_display
-
d6_comment_entity_form_display
-
d6_filter_format
required
:
-
d6_node
-
d6_user
-
d6_comment_entity_display
-
d6_comment_entity_form_display
-
d6_filter_format
core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_entity_display.yml
View file @
fcc5f3b2
...
...
@@ -20,4 +20,5 @@ process:
destination
:
plugin
:
component_entity_display
migration_dependencies
:
-
d6_comment_field_instance
required
:
-
d6_comment_field_instance
core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_entity_form_display.yml
View file @
fcc5f3b2
...
...
@@ -19,4 +19,5 @@ process:
destination
:
plugin
:
component_entity_form_display
migration_dependencies
:
-
d6_comment_field_instance
required
:
-
d6_comment_field_instance
core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_field_instance.yml
View file @
fcc5f3b2
...
...
@@ -24,5 +24,6 @@ process:
destination
:
plugin
:
entity:field_instance_config
migration_dependencies
:
-
d6_comment_field
-
d6_node_type
required
:
-
d6_comment_field
-
d6_node_type
core/modules/migrate_drupal/config/install/migrate.migration.d6_custom_block.yml
View file @
fcc5f3b2
...
...
@@ -16,4 +16,5 @@ process:
destination
:
plugin
:
entity:custom_block
migration_dependencies
:
-
d6_filter_format
required
:
-
d6_filter_format
core/modules/migrate_drupal/config/install/migrate.migration.d6_field.yml
View file @
fcc5f3b2
...
...
@@ -77,7 +77,8 @@ process:
destination
:
plugin
:
entity:field_config
migration_dependencies
:
# It is not possible to make this a requirement as d6_field_settings has no
# source id. However it also has no requirements so it will always run so a
# dependency is enough.
-
d6_field_settings
:
false
optional
:
# It is not possible to make this required as d6_field_settings has no
# source id. However it also has no required dependencies so it will always
# run so an optional dependency is enough.
-
d6_field_settings
core/modules/migrate_drupal/config/install/migrate.migration.d6_field_formatter_settings.yml
View file @
fcc5f3b2
...
...
@@ -294,5 +294,6 @@ process:
destination
:
plugin
:
component_entity_display
migration_dependencies
:
-
d6_field_instance
-
d6_view_modes
required
:
-
d6_field_instance
-
d6_view_modes
core/modules/migrate_drupal/config/install/migrate.migration.d6_field_instance.yml
View file @
fcc5f3b2
...
...
@@ -44,5 +44,6 @@ process:
destination
:
plugin
:
entity:field_instance_config
migration_dependencies
:
-
d6_node_type
-
d6_field
required
:
-
d6_node_type
-
d6_field
core/modules/migrate_drupal/config/install/migrate.migration.d6_field_instance_widget_settings.yml
View file @
fcc5f3b2
...
...
@@ -54,4 +54,5 @@ process:
destination
:
plugin
:
component_entity_form_display
migration_dependencies
:
-
d6_field_instance
required
:
-
d6_field_instance
core/modules/migrate_drupal/config/install/migrate.migration.d6_file.yml
View file @
fcc5f3b2
# Every migration that saves into {file_managed} must have the d6_file
# migration as an optional dependency to ensure d6_file runs first.
id
:
d6_file
label
:
Drupal 6 files
source
:
...
...
core/modules/migrate_drupal/config/install/migrate.migration.d6_node.yml
View file @
fcc5f3b2
...
...
@@ -29,8 +29,10 @@ process:
destination
:
plugin
:
entity:node
migration_dependencies
:
-
d6_node_type
-
d6_filter_format
-
d6_field_instance_widget_settings
:
false
-
d6_field_formatter_settings
:
false
-
d6_node_settings
:
false
required
:
-
d6_node_type
-
d6_filter_format
optional
:
-
d6_field_instance_widget_settings
-
d6_field_formatter_settings
-
d6_node_settings
core/modules/migrate_drupal/config/install/migrate.migration.d6_node_revision.yml
View file @
fcc5f3b2
...
...
@@ -29,4 +29,5 @@ process:
destination
:
plugin
:
entity_revision:node
migration_dependencies
:
-
d6_node
required
:
-
d6_node
core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml
View file @
fcc5f3b2
...
...
@@ -10,4 +10,5 @@ destination:
plugin
:
config
config_name
:
node.settings
migration_dependencies
:
-
d6_node_type
required
:
-
d6_node_type
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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