Commit fca71fa1 authored by alexpott's avatar alexpott

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

Revert "Issue #2560795 by mikeryan, phenaproxima, penyaskito, willwh, benjy: Source plugins have a hidden dependency on migrate_drupal"

This reverts commit 89815ba3.
parent 1fa26afd
......@@ -37,4 +37,3 @@ process:
callable: unserialize
destination:
plugin: entity:action
provider: migrate_drupal
......@@ -11,4 +11,3 @@ process:
destination:
plugin: config
config_name: action.settings
provider: migrate_drupal
......@@ -34,4 +34,3 @@ process:
callable: unserialize
destination:
plugin: entity:action
provider: migrate_drupal
......@@ -17,4 +17,3 @@ process:
modified: modified
destination:
plugin: entity:aggregator_feed
provider: migrate_drupal
......@@ -21,4 +21,3 @@ destination:
migration_dependencies:
required:
- d6_aggregator_feed
provider: migrate_drupal
......@@ -23,4 +23,3 @@ process:
destination:
plugin: config
config_name: aggregator.settings
provider: migrate_drupal
......@@ -18,4 +18,3 @@ process:
modified: modified
destination:
plugin: entity:aggregator_feed
provider: migrate_drupal
......@@ -21,4 +21,3 @@ destination:
migration_dependencies:
required:
- d7_aggregator_feed
provider: migrate_drupal
......@@ -23,4 +23,3 @@ process:
destination:
plugin: config
config_name: aggregator.settings
provider: migrate_drupal
......@@ -8,4 +8,3 @@ process:
ip: ip
destination:
plugin: blocked_ip
provider: migrate_drupal
......@@ -98,4 +98,3 @@ migration_dependencies:
- menu
- d6_custom_block
- d6_user_role
provider: migrate_drupal
......@@ -101,4 +101,3 @@ migration_dependencies:
optional:
- d7_custom_block
- d7_user_role
provider: migrate_drupal
......@@ -30,4 +30,3 @@ destination:
migration_dependencies:
required:
- block_content_type
provider: migrate_drupal
......@@ -17,4 +17,3 @@ process:
label: label
destination:
plugin: entity:block_content_type
provider: migrate_drupal
......@@ -20,4 +20,3 @@ migration_dependencies:
required:
- d6_filter_format
- block_content_body_field
provider: migrate_drupal
......@@ -20,4 +20,3 @@ migration_dependencies:
required:
- d7_filter_format
- block_content_body_field
provider: migrate_drupal
......@@ -21,4 +21,3 @@ destination:
migration_dependencies:
required:
- d6_node
provider: migrate_drupal
......@@ -15,4 +15,3 @@ process:
destination:
plugin: config
config_name: book.settings
provider: migrate_drupal
......@@ -43,4 +43,3 @@ migration_dependencies:
- d6_comment_entity_form_display
- d6_user
- d6_filter_format
provider: migrate_drupal
......@@ -23,4 +23,3 @@ destination:
migration_dependencies:
required:
- d6_comment_field_instance
provider: migrate_drupal
......@@ -22,4 +22,3 @@ destination:
migration_dependencies:
required:
- d6_comment_field_instance
provider: migrate_drupal
......@@ -29,4 +29,3 @@ destination:
migration_dependencies:
required:
- d6_comment_type
provider: migrate_drupal
......@@ -17,4 +17,3 @@ destination:
migration_dependencies:
required:
- d6_comment_type
provider: migrate_drupal
......@@ -42,4 +42,3 @@ migration_dependencies:
required:
- d6_comment_field
- d6_node_type
provider: migrate_drupal
......@@ -13,4 +13,3 @@ process:
description: description
destination:
plugin: entity:comment_type
provider: migrate_drupal
......@@ -33,4 +33,3 @@ migration_dependencies:
required:
- d7_node
- d7_comment_type
provider: migrate_drupal
......@@ -22,4 +22,3 @@ destination:
migration_dependencies:
required:
- d7_comment_field_instance
provider: migrate_drupal
......@@ -22,4 +22,3 @@ destination:
migration_dependencies:
required:
- d7_comment_field_instance
provider: migrate_drupal
......@@ -28,4 +28,3 @@ destination:
migration_dependencies:
required:
- d7_comment_type
provider: migrate_drupal
......@@ -17,4 +17,3 @@ destination:
migration_dependencies:
required:
- d7_comment_type
provider: migrate_drupal
......@@ -25,4 +25,3 @@ destination:
migration_dependencies:
required:
- d7_comment_field
provider: migrate_drupal
......@@ -15,4 +15,3 @@ destination:
migration_dependencies:
required:
- d7_node_type
provider: migrate_drupal
......@@ -21,4 +21,3 @@ process:
weight: weight
destination:
plugin: entity:contact_form
provider: migrate_drupal
......@@ -20,4 +20,3 @@ destination:
migration_dependencies:
required:
- contact_category
provider: migrate_drupal
......@@ -26,4 +26,3 @@ dependencies:
module:
- contact
- migrate_drupal
provider: migrate_drupal
......@@ -11,4 +11,3 @@ process:
destination:
plugin: config
config_name: dblog.settings
provider: migrate_drupal
......@@ -11,4 +11,3 @@ process:
destination:
plugin: config
config_name: dblog.settings
provider: migrate_drupal
......@@ -129,4 +129,3 @@ process:
destination:
plugin: md_entity:field_storage_config
provider: migrate_drupal
......@@ -262,4 +262,3 @@ migration_dependencies:
required:
- d6_field_instance
- d6_view_modes
provider: migrate_drupal
......@@ -59,4 +59,3 @@ migration_dependencies:
required:
- d6_node_type
- d6_field
provider: migrate_drupal
......@@ -67,4 +67,3 @@ destination:
migration_dependencies:
required:
- d6_field_instance
provider: migrate_drupal
......@@ -40,4 +40,3 @@ process:
plugin: d7_field_settings
destination:
plugin: entity:field_storage_config
provider: migrate_drupal
......@@ -75,4 +75,3 @@ migration_dependencies:
required:
- d7_field_instance
- d7_view_modes
provider: migrate_drupal
......@@ -35,4 +35,3 @@ migration_dependencies:
optional:
- d7_node_type
- d7_comment_type
provider: migrate_drupal
......@@ -58,4 +58,3 @@ destination:
migration_dependencies:
required:
- d7_field_instance
provider: migrate_drupal
......@@ -25,4 +25,3 @@ process:
targetEntityType: entity_type
destination:
plugin: entity:entity_view_mode
provider: migrate_drupal
......@@ -24,4 +24,3 @@ process:
destination:
plugin: entity:file
urlencode: true
provider: migrate_drupal
......@@ -15,4 +15,3 @@ process:
destination:
plugin: config
config_name: file.settings
provider: migrate_drupal
......@@ -25,4 +25,3 @@ migration_dependencies:
- d6_file
- d6_node
- d6_upload_field_instance
provider: migrate_drupal
......@@ -25,4 +25,3 @@ destination:
migration_dependencies:
required:
- d6_upload_field_instance
provider: migrate_drupal
......@@ -26,4 +26,3 @@ destination:
migration_dependencies:
required:
- d6_upload_field_instance
provider: migrate_drupal
......@@ -21,4 +21,3 @@ process:
'settings/display_field': 'constants/display_field'
destination:
plugin: md_entity:field_storage_config
provider: migrate_drupal
......@@ -29,4 +29,3 @@ migration_dependencies:
required:
- d6_upload_field
- d6_node_type
provider: migrate_drupal
......@@ -24,4 +24,3 @@ destination:
plugin: entity:file
source_path_property: filepath
urlencode: true
provider: migrate_drupal
......@@ -37,4 +37,3 @@ process:
destination:
plugin: entity:filter_format
no_stub: true
provider: migrate_drupal
......@@ -29,4 +29,3 @@ process:
weight: weight
destination:
plugin: entity:filter_format
provider: migrate_drupal
......@@ -27,4 +27,3 @@ destination:
migration_dependencies:
required:
- d6_taxonomy_vocabulary
provider: migrate_drupal
......@@ -27,4 +27,3 @@ destination:
migration_dependencies:
required:
- d7_taxonomy_vocabulary
provider: migrate_drupal
......@@ -22,4 +22,3 @@ process:
- data
destination:
plugin: entity:image_style
provider: migrate_drupal
......@@ -15,4 +15,3 @@ process:
destination:
plugin: config
config_name: image.settings
provider: migrate_drupal
......@@ -16,4 +16,3 @@ process:
data: data
destination:
plugin: entity:image_style
provider: migrate_drupal
......@@ -13,4 +13,3 @@ process:
destination:
plugin: config
config_name: language.negotiation
provider: migrate_drupal
......@@ -17,4 +17,3 @@ process:
weight: weight
destination:
plugin: entity:configurable_language
provider: migrate_drupal
......@@ -14,4 +14,3 @@ process:
destination:
plugin: config
config_name: locale.settings
provider: migrate_drupal
......@@ -51,4 +51,3 @@ destination:
migration_dependencies:
required:
- menu
provider: migrate_drupal
......@@ -12,4 +12,3 @@ 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 MigrateContainerDerivativeDiscoveryDecorator($yaml_discovery, $this->moduleHandler);
$this->discovery = new ContainerDerivativeDiscoveryDecorator($yaml_discovery);
}
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,4 +29,3 @@ destination:
- mail
# It's possible to overwrite nested properties too.
- 'signature/value'
provider: migrate_drupal
......@@ -50,4 +50,3 @@ migration_dependencies:
- d6_field_instance_widget_settings
- d6_field_formatter_settings
- d6_upload_field_instance
provider: migrate_drupal
......@@ -37,4 +37,3 @@ process:
destination:
plugin: entity_revision:node
provider: migrate_drupal
......@@ -20,4 +20,3 @@ destination:
migration_dependencies:
required:
- d6_node_type
provider: migrate_drupal
......@@ -17,4 +17,3 @@ destination:
migration_dependencies:
required:
- d6_node_type
provider: migrate_drupal
......@@ -20,4 +20,3 @@ destination:
migration_dependencies:
required:
- d6_node_type
provider: migrate_drupal
......@@ -11,4 +11,3 @@ process:
destination:
plugin: config
config_name: node.settings
provider: migrate_drupal
......@@ -22,4 +22,3 @@ process:
create_body_label: body_label
destination:
plugin: entity:node_type
provider: migrate_drupal
......@@ -36,4 +36,3 @@ process:
status: 'constants/status'
destination:
plugin: entity:entity_view_mode
provider: migrate_drupal
......@@ -30,4 +30,3 @@ migration_dependencies:
- d7_node_type
optional:
- d7_field_instance
provider: migrate_drupal
......@@ -27,4 +27,3 @@ destination:
migration_dependencies:
required:
- d7_node
provider: migrate_drupal
......@@ -11,4 +11,3 @@ process:
destination:
plugin: config
config_name: node.settings
provider: migrate_drupal
......@@ -17,4 +17,3 @@ destination:
migration_dependencies:
required:
- d7_node_type
provider: migrate_drupal
......@@ -19,4 +19,3 @@ process:
create_body_label: body_label
destination:
plugin: entity:node_type
provider: migrate_drupal
......@@ -22,4 +22,3 @@ process:
source: language
destination:
plugin: url_alias
provider: migrate_drupal
......@@ -20,4 +20,3 @@ process:
langcode: language
destination:
plugin: url_alias
provider: migrate_drupal
......@@ -20,4 +20,3 @@ process:
destination:
plugin: config
config_name: search.settings
provider: migrate_drupal
......@@ -30,4 +30,3 @@ process:
destination:
plugin: config
config_name: search.settings
provider: migrate_drupal
......@@ -24,4 +24,3 @@ process:
plugin: search_configuration_rankings
destination:
plugin: entity:search_page
provider: migrate_drupal
......@@ -24,4 +24,3 @@ migration_dependencies:
required:
- d7_shortcut_set
- menu_links
provider: migrate_drupal
......@@ -18,4 +18,3 @@ process:
label: title
destination:
plugin: entity:shortcut_set
provider: migrate_drupal
......@@ -23,4 +23,3 @@ migration_dependencies:
required:
- d7_shortcut_set
- d7_user
provider: migrate_drupal
......@@ -19,4 +19,3 @@ process:
destination:
plugin: config
config_name: simpletest.settings
provider: migrate_drupal
......@@ -19,4 +19,3 @@ process:
destination:
plugin: config
config_name: simpletest.settings
provider: migrate_drupal
......@@ -15,4 +15,3 @@ process:
destination:
plugin: config
config_name: statistics.settings
provider: migrate_drupal