Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
|
@ -2,8 +2,10 @@
|
|||
|
||||
namespace Drupal\migrate_drupal\Plugin\migrate\destination;
|
||||
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Entity\EntityStorageInterface;
|
||||
use Drupal\Core\Field\FieldTypePluginManagerInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig as BaseEntityFieldStorageConfig;
|
||||
|
@ -45,11 +47,17 @@ class EntityFieldStorageConfig extends BaseEntityFieldStorageConfig {
|
|||
* The storage for this entity type.
|
||||
* @param array $bundles
|
||||
* The list of bundles this entity type has.
|
||||
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
|
||||
* The language manager.
|
||||
* @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_plugin_manager
|
||||
* The field type plugin manager.
|
||||
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||
* The configuration factory.
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, FieldTypePluginManagerInterface $field_type_plugin_manager) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles);
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, FieldTypePluginManagerInterface $field_type_plugin_manager) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $language_manager, $config_factory, $field_type_plugin_manager);
|
||||
$this->languageManager = $language_manager;
|
||||
$this->configFactory = $config_factory;
|
||||
$this->fieldTypePluginManager = $field_type_plugin_manager;
|
||||
}
|
||||
|
||||
|
@ -65,6 +73,8 @@ class EntityFieldStorageConfig extends BaseEntityFieldStorageConfig {
|
|||
$migration,
|
||||
$container->get('entity.manager')->getStorage($entity_type_id),
|
||||
array_keys($container->get('entity.manager')->getBundleInfo($entity_type_id)),
|
||||
$container->get('language_manager'),
|
||||
$container->get('config.factory'),
|
||||
$container->get('plugin.manager.field.field_type')
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ use Drupal\Core\State\StateInterface;
|
|||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Drupal\migrate\Exception\RequirementsException;
|
||||
use Drupal\migrate\Plugin\migrate\source\SqlBase;
|
||||
use Drupal\migrate\Plugin\RequirementsInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
|
@ -19,7 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
* Mainly to let children retrieve information from the origin system in an
|
||||
* easier way.
|
||||
*/
|
||||
abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginInterface, RequirementsInterface, DependentPluginInterface {
|
||||
abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginInterface, DependentPluginInterface {
|
||||
|
||||
use DependencyTrait;
|
||||
|
||||
|
@ -60,7 +59,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
|
|||
*/
|
||||
public function getSystemData() {
|
||||
if (!isset($this->systemData)) {
|
||||
$this->systemData = array();
|
||||
$this->systemData = [];
|
||||
try {
|
||||
$results = $this->select('system', 's')
|
||||
->fields('s')
|
||||
|
@ -106,6 +105,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
|
|||
}
|
||||
}
|
||||
}
|
||||
parent::checkRequirements();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,7 +149,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
|
|||
protected function variableGet($name, $default) {
|
||||
try {
|
||||
$result = $this->select('variable', 'v')
|
||||
->fields('v', array('value'))
|
||||
->fields('v', ['value'])
|
||||
->condition('name', $name)
|
||||
->execute()
|
||||
->fetchField();
|
||||
|
|
|
@ -37,7 +37,7 @@ class Variable extends DrupalSqlBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeIterator() {
|
||||
return new \ArrayIterator(array($this->values()));
|
||||
return new \ArrayIterator([$this->values()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ class Variable extends DrupalSqlBase {
|
|||
public function query() {
|
||||
return $this->getDatabase()
|
||||
->select('variable', 'v')
|
||||
->fields('v', array('name', 'value'))
|
||||
->fields('v', ['name', 'value'])
|
||||
->condition('name', $this->variables, 'IN');
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class VariableMultiRow extends DrupalSqlBase {
|
|||
*/
|
||||
public function query() {
|
||||
return $this->select('variable', 'v')
|
||||
->fields('v', array('name', 'value'))
|
||||
->fields('v', ['name', 'value'])
|
||||
// Cast scalars to array so we can consistently use an IN condition.
|
||||
->condition('name', (array) $this->configuration['variables'], 'IN');
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ class VariableMultiRow extends DrupalSqlBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function fields() {
|
||||
return array(
|
||||
return [
|
||||
'name' => $this->t('Name'),
|
||||
'value' => $this->t('Value'),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@ class Config extends DrupalSqlBase {
|
|||
*/
|
||||
public function query() {
|
||||
$query = $this->select('config', 'c')
|
||||
->fields('c', array('collection', 'name', 'data'));
|
||||
->fields('c', ['collection', 'name', 'data']);
|
||||
if (!empty($this->configuration['collections'])) {
|
||||
$query->condition('collection', (array) $this->configuration['collections'], 'IN');
|
||||
}
|
||||
|
|
Reference in a new issue