Update to Drupal 8.0.3. For more information, see https://www.drupal.org/drupal-8.0.3-release-notes

This commit is contained in:
Pantheon Automation 2016-02-03 14:56:31 -08:00 committed by Greg Anderson
parent 10f9f7fbde
commit 9db4fae9a7
202 changed files with 3806 additions and 760 deletions

View file

@ -18,7 +18,7 @@ abstract class ConfigFactoryOverrideBase implements EventSubscriberInterface {
* Reacts to the ConfigEvents::COLLECTION_INFO event.
*
* @param \Drupal\Core\Config\ConfigCollectionInfo $collection_info
* The configuration collection names event.
* The configuration collection info event.
*/
abstract public function addCollections(ConfigCollectionInfo $collection_info);

View file

@ -39,16 +39,6 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
*/
protected $originalId;
/**
* The name of the property that is used to store plugin configuration.
*
* This is needed when the entity uses a LazyPluginCollection, to dictate
* where the plugin configuration should be stored.
*
* @var string
*/
protected $pluginConfigKey;
/**
* The enabled/disabled status of the configuration entity.
*

View file

@ -169,9 +169,6 @@ interface ConfigEntityInterface extends EntityInterface, ThirdPartySettingsInter
* Dependency types are, for example, entity, module and theme.
*
* @return bool
* TRUE if the entity has changed, FALSE if not.
*
* @return bool
* TRUE if the entity has been changed as a result, FALSE if not.
*
* @see \Drupal\Core\Config\Entity\ConfigDependencyManager

View file

@ -95,12 +95,13 @@ class FileStorage implements StorageInterface {
if (!$this->exists($name)) {
return FALSE;
}
$data = file_get_contents($this->getFilePath($name));
$filepath = $this->getFilePath($name);
$data = file_get_contents($filepath);
try {
$data = $this->decode($data);
}
catch (InvalidDataTypeException $e) {
throw new UnsupportedDataTypeConfigException("Invalid data type in config $name: {$e->getMessage()}");
throw new UnsupportedDataTypeConfigException('Invalid data type in config ' . $name . ', found in file' . $filepath . ' : ' . $e->getMessage());
}
return $data;
}

View file

@ -86,6 +86,7 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
// Add default values for data type and replace variables.
$definition += array('type' => 'undefined');
$replace = [];
$type = $definition['type'];
if (strpos($type, ']')) {
// Replace variable names in definition.
@ -102,7 +103,7 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
unset($definition['type']);
}
// Add default values from type definition.
$definition += $this->getDefinition($type);
$definition += $this->_getDefinitionWithReplacements($type, $replace);
$data_definition = $this->createDataDefinition($definition['type']);
@ -116,10 +117,17 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
}
/**
* {@inheritdoc}
* Determines the typed config type for a plugin ID.
*
* @param string $base_plugin_id
* The plugin ID.
* @param array $definitions
* An array of typed config definitions.
*
* @return string
* The typed config type for the given plugin ID.
*/
public function getDefinition($base_plugin_id, $exception_on_invalid = TRUE) {
$definitions = $this->getDefinitions();
protected function _determineType($base_plugin_id, array $definitions) {
if (isset($definitions[$base_plugin_id])) {
$type = $base_plugin_id;
}
@ -131,6 +139,27 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
// If we don't have definition, return the 'undefined' element.
$type = 'undefined';
}
return $type;
}
/**
* Gets a schema definition with replacements for dynamic names.
*
* @param string $base_plugin_id
* A plugin ID.
* @param array $replacements
* An array of replacements for dynamic type names.
* @param bool $exception_on_invalid
* (optional) This parameter is passed along to self::getDefinition().
* However, self::getDefinition() does not respect this parameter, so it is
* effectively useless in this context.
*
* @return array
* A schema definition array.
*/
protected function _getDefinitionWithReplacements($base_plugin_id, array $replacements, $exception_on_invalid = TRUE) {
$definitions = $this->getDefinitions();
$type = $this->_determineType($base_plugin_id, $definitions);
$definition = $definitions[$type];
// Check whether this type is an extension of another one and compile it.
if (isset($definition['type'])) {
@ -138,6 +167,15 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
// Preserve integer keys on merge, so sequence item types can override
// parent settings as opposed to adding unused second, third, etc. items.
$definition = NestedArray::mergeDeepArray(array($merge, $definition), TRUE);
// Replace dynamic portions of the definition type.
if (!empty($replacements) && strpos($definition['type'], ']')) {
$sub_type = $this->_determineType($this->replaceName($definition['type'], $replacements), $definitions);
// Merge the newly determined subtype definition with the original
// definition.
$definition = NestedArray::mergeDeepArray([$definitions[$sub_type], $definition], TRUE);
}
// Unset type so we try the merge only once per type.
unset($definition['type']);
$this->definitions[$type] = $definition;
@ -150,6 +188,13 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
return $definition;
}
/**
* {@inheritdoc}
*/
public function getDefinition($base_plugin_id, $exception_on_invalid = TRUE) {
return $this->_getDefinitionWithReplacements($base_plugin_id, [], $exception_on_invalid);
}
/**
* {@inheritdoc}
*/