Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713
This commit is contained in:
parent
c0a0d5a94c
commit
9eae24d844
669 changed files with 3873 additions and 1553 deletions
|
@ -49,4 +49,3 @@ class ConfigCrudEvent extends Event {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface
|
|||
// $this->configFactoryOverrides, add cache keys for each.
|
||||
$keys[] = 'global_overrides';
|
||||
foreach($this->configFactoryOverrides as $override) {
|
||||
$keys[] = $override->getCacheSuffix();
|
||||
$keys[] = $override->getCacheSuffix();
|
||||
}
|
||||
return $keys;
|
||||
}
|
||||
|
|
|
@ -484,14 +484,17 @@ class ConfigImporter {
|
|||
*/
|
||||
public function doSyncStep($sync_step, &$context) {
|
||||
if (!is_array($sync_step) && method_exists($this, $sync_step)) {
|
||||
\Drupal::service('config.installer')->setSyncing(TRUE);
|
||||
$this->$sync_step($context);
|
||||
}
|
||||
elseif (is_callable($sync_step)) {
|
||||
\Drupal::service('config.installer')->setSyncing(TRUE);
|
||||
call_user_func_array($sync_step, array(&$context, $this));
|
||||
}
|
||||
else {
|
||||
throw new \InvalidArgumentException('Invalid configuration synchronization step');
|
||||
}
|
||||
\Drupal::service('config.installer')->setSyncing(FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -778,7 +781,6 @@ class ConfigImporter {
|
|||
// Set the config installer to use the sync directory instead of the
|
||||
// extensions own default config directories.
|
||||
\Drupal::service('config.installer')
|
||||
->setSyncing(TRUE)
|
||||
->setSourceStorage($this->storageComparer->getSourceStorage());
|
||||
if ($type == 'module') {
|
||||
$this->moduleInstaller->$op(array($name), FALSE);
|
||||
|
@ -805,8 +807,6 @@ class ConfigImporter {
|
|||
}
|
||||
|
||||
$this->setProcessedExtension($type, $op, $name);
|
||||
\Drupal::service('config.installer')
|
||||
->setSyncing(FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -100,4 +100,3 @@ class ConfigModuleOverridesEvent extends Event {
|
|||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@ use Drupal\Component\Utility\SortArray;
|
|||
* The configuration dependency value is structured like this:
|
||||
* @code
|
||||
* array(
|
||||
* 'config => array(
|
||||
* 'config' => array(
|
||||
* // An array of configuration entity object names. Recalculated on save.
|
||||
* ),
|
||||
* 'content => array(
|
||||
* 'content' => array(
|
||||
* // An array of content entity configuration dependency names. The default
|
||||
* // format is "ENTITY_TYPE_ID:BUNDLE:UUID". Recalculated on save.
|
||||
* ),
|
||||
|
@ -165,7 +165,7 @@ class ConfigDependencyManager {
|
|||
// If checking content, module, or theme dependencies, discover which
|
||||
// entities are dependent on the entities that have a direct dependency.
|
||||
foreach ($dependent_entities as $entity) {
|
||||
$entities_to_check[] = $entity->getConfigDependencyName();
|
||||
$entities_to_check[] = $entity->getConfigDependencyName();
|
||||
}
|
||||
}
|
||||
$dependencies = array_merge($this->createGraphConfigEntityDependencies($entities_to_check), $dependent_entities);
|
||||
|
@ -291,10 +291,10 @@ class ConfigDependencyManager {
|
|||
* The configuration dependencies. The array is structured like this:
|
||||
* @code
|
||||
* array(
|
||||
* 'config => array(
|
||||
* 'config' => array(
|
||||
* // An array of configuration entity object names.
|
||||
* ),
|
||||
* 'content => array(
|
||||
* 'content' => array(
|
||||
* // An array of content entity configuration dependency names. The default
|
||||
* // format is "ENTITY_TYPE_ID:BUNDLE:UUID".
|
||||
* ),
|
||||
|
|
|
@ -382,8 +382,7 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function importCreate($name, Config $new_config, Config $old_config) {
|
||||
$entity = $this->createFromStorageRecord($new_config->get());
|
||||
$entity->setSyncing(TRUE);
|
||||
$entity = $this->_doCreateFromStorageRecord($new_config->get(), TRUE);
|
||||
$entity->save();
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -425,6 +424,27 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function createFromStorageRecord(array $values) {
|
||||
return $this->_doCreateFromStorageRecord($values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helps create a configuration entity from storage values.
|
||||
*
|
||||
* Allows the configuration entity storage to massage storage values before
|
||||
* creating an entity.
|
||||
*
|
||||
* @param array $values
|
||||
* The array of values from the configuration storage.
|
||||
* @param bool $is_syncing
|
||||
* Is the configuration entity being created as part of a config sync.
|
||||
*
|
||||
* @return ConfigEntityInterface
|
||||
* The configuration entity.
|
||||
*
|
||||
* @see \Drupal\Core\Config\Entity\ConfigEntityStorageInterface::createFromStorageRecord()
|
||||
* @see \Drupal\Core\Config\Entity\ImportableEntityStorageInterface::importCreate()
|
||||
*/
|
||||
protected function _doCreateFromStorageRecord(array $values, $is_syncing = FALSE) {
|
||||
// Assign a new UUID if there is none yet.
|
||||
if ($this->uuidKey && $this->uuidService && !isset($values[$this->uuidKey])) {
|
||||
$values[$this->uuidKey] = $this->uuidService->generate();
|
||||
|
@ -432,6 +452,7 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora
|
|||
$data = $this->mapFromStorageRecords(array($values));
|
||||
$entity = current($data);
|
||||
$entity->original = clone $entity;
|
||||
$entity->setSyncing($is_syncing);
|
||||
$entity->enforceIsNew();
|
||||
$entity->postCreate($this);
|
||||
|
||||
|
@ -439,6 +460,7 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora
|
|||
// entity object, for instance to fill-in default values.
|
||||
$this->invokeHook('create', $entity);
|
||||
return $entity;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -132,4 +132,3 @@ class ExtensionInstallStorage extends InstallStorage {
|
|||
return $this->folders;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,13 +60,13 @@ abstract class StorableConfigBase extends ConfigBase {
|
|||
/**
|
||||
* Saves the configuration object.
|
||||
*
|
||||
* Must invalidate the cache tags associated with the configuration object.
|
||||
*
|
||||
* @param bool $has_trusted_data
|
||||
* Set to TRUE if the configuration data has already been checked to ensure
|
||||
* it conforms to schema. Generally this is only used during module and
|
||||
* theme installation.
|
||||
*
|
||||
* Must invalidate the cache tags associated with the configuration object.
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @see \Drupal\Core\Config\ConfigInstaller::createConfiguration()
|
||||
|
@ -191,7 +191,7 @@ abstract class StorableConfigBase extends ConfigBase {
|
|||
// we have to special case the meaning of an empty string for numeric
|
||||
// types. In PHP this would be casted to a 0 but for the purposes of
|
||||
// configuration we need to treat this as a NULL.
|
||||
$empty_value = $value === '' && ($element instanceof IntegerInterface || $element instanceof FloatInterface);
|
||||
$empty_value = $value === '' && ($element instanceof IntegerInterface || $element instanceof FloatInterface);
|
||||
|
||||
if ($value === NULL || $empty_value) {
|
||||
$value = NULL;
|
||||
|
|
Reference in a new issue