Commit 89815ba3 authored by alexpott's avatar alexpott

Issue #2560795 by mikeryan, phenaproxima, penyaskito, willwh, benjy: Source...

Issue #2560795 by mikeryan, phenaproxima, penyaskito, willwh, benjy: Source plugins have a hidden dependency on migrate_drupal
parent 05a3cb70
......@@ -37,3 +37,4 @@ process:
callable: unserialize
destination:
plugin: entity:action
provider: migrate_drupal
......@@ -11,3 +11,4 @@ process:
destination:
plugin: config
config_name: action.settings
provider: migrate_drupal
......@@ -34,3 +34,4 @@ process:
callable: unserialize
destination:
plugin: entity:action
provider: migrate_drupal
......@@ -17,3 +17,4 @@ process:
modified: modified
destination:
plugin: entity:aggregator_feed
provider: migrate_drupal
......@@ -21,3 +21,4 @@ destination:
migration_dependencies:
required:
- d6_aggregator_feed
provider: migrate_drupal
......@@ -23,3 +23,4 @@ process:
destination:
plugin: config
config_name: aggregator.settings
provider: migrate_drupal
......@@ -18,3 +18,4 @@ process:
modified: modified
destination:
plugin: entity:aggregator_feed
provider: migrate_drupal
......@@ -21,3 +21,4 @@ destination:
migration_dependencies:
required:
- d7_aggregator_feed
provider: migrate_drupal
......@@ -23,3 +23,4 @@ process:
destination:
plugin: config
config_name: aggregator.settings
provider: migrate_drupal
......@@ -8,3 +8,4 @@ process:
ip: ip
destination:
plugin: blocked_ip
provider: migrate_drupal
......@@ -98,3 +98,4 @@ migration_dependencies:
- menu
- d6_custom_block
- d6_user_role
provider: migrate_drupal
......@@ -101,3 +101,4 @@ migration_dependencies:
optional:
- d7_custom_block
- d7_user_role
provider: migrate_drupal
......@@ -30,3 +30,4 @@ destination:
migration_dependencies:
required:
- block_content_type
provider: migrate_drupal
......@@ -17,3 +17,4 @@ process:
label: label
destination:
plugin: entity:block_content_type
provider: migrate_drupal
......@@ -20,3 +20,4 @@ migration_dependencies:
required:
- d6_filter_format
- block_content_body_field
provider: migrate_drupal
......@@ -20,3 +20,4 @@ migration_dependencies:
required:
- d7_filter_format
- block_content_body_field
provider: migrate_drupal
......@@ -21,3 +21,4 @@ destination:
migration_dependencies:
required:
- d6_node
provider: migrate_drupal
......@@ -15,3 +15,4 @@ process:
destination:
plugin: config
config_name: book.settings
provider: migrate_drupal
......@@ -43,3 +43,4 @@ migration_dependencies:
- d6_comment_entity_form_display
- d6_user
- d6_filter_format
provider: migrate_drupal
......@@ -23,3 +23,4 @@ destination:
migration_dependencies:
required:
- d6_comment_field_instance
provider: migrate_drupal
......@@ -22,3 +22,4 @@ destination:
migration_dependencies:
required:
- d6_comment_field_instance
provider: migrate_drupal
......@@ -29,3 +29,4 @@ destination:
migration_dependencies:
required:
- d6_comment_type
provider: migrate_drupal
......@@ -17,3 +17,4 @@ destination:
migration_dependencies:
required:
- d6_comment_type
provider: migrate_drupal
......@@ -42,3 +42,4 @@ migration_dependencies:
required:
- d6_comment_field
- d6_node_type
provider: migrate_drupal
......@@ -13,3 +13,4 @@ process:
description: description
destination:
plugin: entity:comment_type
provider: migrate_drupal
......@@ -33,3 +33,4 @@ migration_dependencies:
required:
- d7_node
- d7_comment_type
provider: migrate_drupal
......@@ -22,3 +22,4 @@ destination:
migration_dependencies:
required:
- d7_comment_field_instance
provider: migrate_drupal
......@@ -22,3 +22,4 @@ destination:
migration_dependencies:
required:
- d7_comment_field_instance
provider: migrate_drupal
......@@ -28,3 +28,4 @@ destination:
migration_dependencies:
required:
- d7_comment_type
provider: migrate_drupal
......@@ -17,3 +17,4 @@ destination:
migration_dependencies:
required:
- d7_comment_type
provider: migrate_drupal
......@@ -25,3 +25,4 @@ destination:
migration_dependencies:
required:
- d7_comment_field
provider: migrate_drupal
......@@ -15,3 +15,4 @@ destination:
migration_dependencies:
required:
- d7_node_type
provider: migrate_drupal
......@@ -21,3 +21,4 @@ process:
weight: weight
destination:
plugin: entity:contact_form
provider: migrate_drupal
......@@ -20,3 +20,4 @@ destination:
migration_dependencies:
required:
- contact_category
provider: migrate_drupal
......@@ -26,3 +26,4 @@ dependencies:
module:
- contact
- migrate_drupal
provider: migrate_drupal
......@@ -11,3 +11,4 @@ process:
destination:
plugin: config
config_name: dblog.settings
provider: migrate_drupal
......@@ -11,3 +11,4 @@ process:
destination:
plugin: config
config_name: dblog.settings
provider: migrate_drupal
......@@ -129,3 +129,4 @@ process:
destination:
plugin: md_entity:field_storage_config
provider: migrate_drupal
......@@ -262,3 +262,4 @@ migration_dependencies:
required:
- d6_field_instance
- d6_view_modes
provider: migrate_drupal
......@@ -59,3 +59,4 @@ migration_dependencies:
required:
- d6_node_type
- d6_field
provider: migrate_drupal
......@@ -67,3 +67,4 @@ destination:
migration_dependencies:
required:
- d6_field_instance
provider: migrate_drupal
......@@ -40,3 +40,4 @@ process:
plugin: d7_field_settings
destination:
plugin: entity:field_storage_config
provider: migrate_drupal
......@@ -75,3 +75,4 @@ migration_dependencies:
required:
- d7_field_instance
- d7_view_modes
provider: migrate_drupal
......@@ -35,3 +35,4 @@ migration_dependencies:
optional:
- d7_node_type
- d7_comment_type
provider: migrate_drupal
......@@ -58,3 +58,4 @@ destination:
migration_dependencies:
required:
- d7_field_instance
provider: migrate_drupal
......@@ -25,3 +25,4 @@ process:
targetEntityType: entity_type
destination:
plugin: entity:entity_view_mode
provider: migrate_drupal
......@@ -24,3 +24,4 @@ process:
destination:
plugin: entity:file
urlencode: true
provider: migrate_drupal
......@@ -15,3 +15,4 @@ process:
destination:
plugin: config
config_name: file.settings
provider: migrate_drupal
......@@ -25,3 +25,4 @@ migration_dependencies:
- d6_file
- d6_node
- d6_upload_field_instance
provider: migrate_drupal
......@@ -25,3 +25,4 @@ destination:
migration_dependencies:
required:
- d6_upload_field_instance
provider: migrate_drupal
......@@ -26,3 +26,4 @@ destination:
migration_dependencies:
required:
- d6_upload_field_instance
provider: migrate_drupal
......@@ -21,3 +21,4 @@ process:
'settings/display_field': 'constants/display_field'
destination:
plugin: md_entity:field_storage_config
provider: migrate_drupal
......@@ -29,3 +29,4 @@ migration_dependencies:
required:
- d6_upload_field
- d6_node_type
provider: migrate_drupal
......@@ -24,3 +24,4 @@ destination:
plugin: entity:file
source_path_property: filepath
urlencode: true
provider: migrate_drupal
......@@ -37,3 +37,4 @@ process:
destination:
plugin: entity:filter_format
no_stub: true
provider: migrate_drupal
......@@ -29,3 +29,4 @@ process:
weight: weight
destination:
plugin: entity:filter_format
provider: migrate_drupal
......@@ -27,3 +27,4 @@ destination:
migration_dependencies:
required:
- d6_taxonomy_vocabulary
provider: migrate_drupal
......@@ -27,3 +27,4 @@ destination:
migration_dependencies:
required:
- d7_taxonomy_vocabulary
provider: migrate_drupal
......@@ -22,3 +22,4 @@ process:
- data
destination:
plugin: entity:image_style
provider: migrate_drupal
......@@ -15,3 +15,4 @@ process:
destination:
plugin: config
config_name: image.settings
provider: migrate_drupal
......@@ -16,3 +16,4 @@ process:
data: data
destination:
plugin: entity:image_style
provider: migrate_drupal
......@@ -13,3 +13,4 @@ process:
destination:
plugin: config
config_name: language.negotiation
provider: migrate_drupal
......@@ -17,3 +17,4 @@ process:
weight: weight
destination:
plugin: entity:configurable_language
provider: migrate_drupal
......@@ -14,3 +14,4 @@ process:
destination:
plugin: config
config_name: locale.settings
provider: migrate_drupal
......@@ -51,3 +51,4 @@ destination:
migration_dependencies:
required:
- menu
provider: migrate_drupal
......@@ -12,3 +12,4 @@ process:
destination:
plugin: config
config_name: menu_ui.settings
provider: migrate_drupal
<?php
namespace Drupal\migrate\Plugin\Discovery;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
/**
* Overrides ContainerDerivativeDiscoveryDecorator to pre-check providers.
*
* @ingroup migration
*/
class MigrateContainerDerivativeDiscoveryDecorator extends ContainerDerivativeDiscoveryDecorator {
/**
* The module handler to invoke the alter hook.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Constructs a new MigrateContainerDerivativeDiscoveryDecorator.
*
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated
* The parent object that is being decorated.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*/
public function __construct(DiscoveryInterface $decorated, ModuleHandlerInterface $module_handler) {
parent::__construct($decorated);
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
protected function getDeriver($base_plugin_id, $base_definition) {
// Short-circuit attempts to instantiate derivers if the base provider is
// not available.
if (isset($base_definition['provider']) && !in_array($base_definition['provider'], ['core', 'component']) && !$this->moduleHandler->moduleExists($base_definition['provider'])) {
return NULL;
}
else {
return parent::getDeriver($base_plugin_id, $base_definition);
}
}
}
......@@ -8,10 +8,10 @@
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
use Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery;
use Drupal\Core\Plugin\Factory\ContainerFactory;
use Drupal\migrate\MigrateBuildDependencyInterface;
use Drupal\migrate\Plugin\Discovery\MigrateContainerDerivativeDiscoveryDecorator;
/**
* Plugin manager for migration plugins.
......@@ -68,7 +68,7 @@ protected function getDiscovery() {
}, $this->moduleHandler->getModuleDirectories());
$yaml_discovery = new YamlDirectoryDiscovery($directories, 'migrate');
$this->discovery = new ContainerDerivativeDiscoveryDecorator($yaml_discovery);
$this->discovery = new MigrateContainerDerivativeDiscoveryDecorator($yaml_discovery, $this->moduleHandler);
}
return $this->discovery;
}
......
<?php
namespace Drupal\Tests\migrate\Kernel\Plugin;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests the migration manager plugin.
*
* @coversDefaultClass \Drupal\migrate\Plugin\MigratePluginManager
* @group migrate
*/
class MigrationPluginListTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'migrate',
// Test with all modules containing Drupal migrations.
'action',
'aggregator',
'ban',
'block',
'block_content',
'book',
'comment',
'contact',
'dblog',
'field',
'file',
'filter',
'forum',
'image',
'language',
'locale',
'menu_link_content',
'menu_ui',
'node',
'path',
'search',
'shortcut',
'simpletest',
'statistics',
'syslog',
'system',
'taxonomy',
'text',
'tracker',
'update',
'user',
];
/**
* Tests MigratePluginManager::getDefinitions()
*
* @covers ::getDefinitions
*/
public function testGetDefinitions() {
// Make sure retrieving all the core migration plugins does not throw any
// errors.
$migration_plugins = $this->container->get('plugin.manager.migration')->getDefinitions();
}
}
......@@ -29,3 +29,4 @@ destination:
- mail
# It's possible to overwrite nested properties too.
- 'signature/value'
provider: migrate_drupal
......@@ -47,3 +47,4 @@ migration_dependencies:
- d6_field_instance_widget_settings
- d6_field_formatter_settings
- d6_upload_field_instance
provider: migrate_drupal
......@@ -37,3 +37,4 @@ process:
destination:
plugin: entity_revision:node
provider: migrate_drupal
......@@ -20,3 +20,4 @@ destination:
migration_dependencies:
required:
- d6_node_type
provider: migrate_drupal
......@@ -17,3 +17,4 @@ destination:
migration_dependencies:
required:
- d6_node_type
provider: migrate_drupal
......@@ -20,3 +20,4 @@ destination:
migration_dependencies:
required:
- d6_node_type
provider: migrate_drupal
......@@ -11,3 +11,4 @@ process:
destination:
plugin: config
config_name: node.settings
provider: migrate_drupal
......@@ -22,3 +22,4 @@ process:
create_body_label: body_label
destination:
plugin: entity:node_type
provider: migrate_drupal
......@@ -36,3 +36,4 @@ process:
status: 'constants/status'
destination:
plugin: entity:entity_view_mode
provider: migrate_drupal
......@@ -30,3 +30,4 @@ migration_dependencies:
- d7_node_type
optional:
- d7_field_instance
provider: migrate_drupal
......@@ -27,3 +27,4 @@ destination:
migration_dependencies:
required:
- d7_node
provider: migrate_drupal
......@@ -11,3 +11,4 @@ process:
destination:
plugin: config
config_name: node.settings
provider: migrate_drupal
......@@ -17,3 +17,4 @@ destination:
migration_dependencies:
required:
- d7_node_type
provider: migrate_drupal
......@@ -19,3 +19,4 @@ process:
create_body_label: body_label
destination:
plugin: entity:node_type
provider: migrate_drupal
......@@ -22,3 +22,4 @@ process:
source: language
destination:
plugin: url_alias
provider: migrate_drupal
......@@ -20,3 +20,4 @@ process:
langcode: language
destination:
plugin: url_alias
provider: migrate_drupal
......@@ -20,3 +20,4 @@ process:
destination:
plugin: config
config_name: search.settings
provider: migrate_drupal
......@@ -30,3 +30,4 @@ process:
destination:
plugin: config
config_name: search.settings
provider: migrate_drupal
......@@ -24,3 +24,4 @@ process:
plugin: search_configuration_rankings
destination:
plugin: entity:search_page
provider: migrate_drupal
......@@ -24,3 +24,4 @@ migration_dependencies:
required:
- d7_shortcut_set
- menu_links
provider: migrate_drupal
......@@ -18,3 +18,4 @@ process:
label: title
destination:
plugin: entity:shortcut_set
provider: migrate_drupal
......@@ -23,3 +23,4 @@ migration_dependencies:
required:
- d7_shortcut_set
- d7_user
provider: migrate_drupal
......@@ -19,3 +19,4 @@ process:
destination:
plugin: config
config_name: simpletest.settings
provider: migrate_drupal
......@@ -19,3 +19,4 @@ process:
destination:
plugin: config
config_name: simpletest.settings
provider: migrate_drupal
......@@ -15,3 +15,4 @@ process:
destination:
plugin: config
config_name: statistics.settings
provider: migrate_drupal