reverted: --- b/core/includes/bootstrap.inc +++ a/core/includes/bootstrap.inc @@ -2467,13 +2467,6 @@ ->addArgument(new Reference('config.storage')) ->addArgument(new Reference('dispatcher')); - // Register theme setting config storage and factory. - $container - ->register('theme_config.storage', 'Drupal\Core\Config\NullStorage'); - $container->register('theme_config.factory', 'Drupal\Core\Config\ConfigFactory') - ->addArgument(new Reference('theme_config.storage')) - ->addArgument(new Reference('dispatcher')); - // Register staging configuration storage. $container ->register('config.storage.staging', 'Drupal\Core\Config\FileStorage') reverted: --- b/core/includes/install.core.inc +++ a/core/includes/install.core.inc @@ -322,14 +322,6 @@ $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory') ->addArgument(new Reference('config.storage')) ->addArgument(new Reference('dispatcher')); - - // Register theme setting config storage and factory. - $container - ->register('theme_config.storage', 'Drupal\Core\Config\NullStorage'); - $container->register('theme_config.factory', 'Drupal\Core\Config\ConfigFactory') - ->addArgument(new Reference('theme_config.storage')) - ->addArgument(new Reference('dispatcher')); - drupal_container($container); } diff -u b/core/includes/theme.inc b/core/includes/theme.inc --- b/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -13,6 +13,7 @@ use Drupal\Core\Config\Config; use Drupal\Core\Template\Attribute; use Drupal\Core\Utility\ThemeRegistry; +use Drupal\Core\Theme\ThemeSettings; /** * @defgroup content_flags Content markers @@ -1352,11 +1353,8 @@ } if (empty($cache[$theme])) { - // Create a config object that will merge $default_config, settings from the - // theme's info file, global theme configuration and the theme's - // configuration. This allows the use of CMI to manage the nested array of - // keys. Saving it could potentially offer performance improvements. - $cache[$theme] = drupal_container()->get('theme_config.factory')->get('cache.theme.' . $theme)->load(); + // Create a theme settings object. + $cache[$theme] = new ThemeSettings($theme); // Get the values for the theme-specific settings from the .info files of // the theme and all its base themes. if ($theme) { reverted: --- b/core/lib/Drupal/Core/CoreBundle.php +++ a/core/lib/Drupal/Core/CoreBundle.php @@ -62,13 +62,6 @@ ->register('config.storage.staging', 'Drupal\Core\Config\FileStorage') ->addArgument(config_get_config_directory(CONFIG_STAGING_DIRECTORY)); - // Register theme setting config storage and factory. - $container - ->register('theme_config.storage', 'Drupal\Core\Config\NullStorage'); - $container->register('theme_config.factory', 'Drupal\Core\Config\ConfigFactory') - ->addArgument(new Reference('theme_config.storage')) - ->addArgument(new Reference('dispatcher')); - // Register the service for the default database connection. $container->register('database', 'Drupal\Core\Database\Connection') ->setFactoryClass('Drupal\Core\Database\Database') diff -u b/core/modules/comment/comment.module b/core/modules/comment/comment.module --- b/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1599,7 +1599,6 @@ $comment->name = check_plain($account->name); $comment->signature = $account->signature; $comment->signature_format = $account->signature_format; - $comment->picture = $account->picture; } elseif (empty($comment->name)) { $comment->name = config('user.settings')->get('anonymous'); only in patch2: unchanged: --- /dev/null +++ b/core/lib/Drupal/Core/Theme/ThemeSettings.php @@ -0,0 +1,146 @@ +theme = $theme; + $this->data = array(); + } + + /** + * Returns the theme of this theme settings object. + * + * @return string + * The theme of this theme settings object. + */ + public function getTheme() { + return $this->theme; + } + + /** + * Gets data from this theme settings object. + * + * @param string $key + * A string that maps to a key within the theme settings data. + * For instance in the following theme settings array: + * @code + * array( + * 'foo' => array( + * 'bar' => 'baz', + * ), + * ); + * @endcode + * A key of 'foo.bar' would return the string 'baz'. However, a key of 'foo' + * would return array('bar' => 'baz'). + * If no key is specified, then the entire data array is returned. + * + * + * @return mixed + * The data that was requested. + */ + public function get($key = '') { + if (empty($key)) { + return $this->data; + } + else { + $parts = explode('.', $key); + if (count($parts) == 1) { + return isset($this->data[$key]) ? $this->data[$key] : NULL; + } + else { + $value = NestedArray::getValue($this->data, $parts, $key_exists); + return $key_exists ? $value : NULL; + } + } + } + + /** + * Replaces the data of this theme settings object. + * + * @param array $data + * The new theme settings data. + * + * @return Drupal\Core\Theme\ThemeSettings + * The theme settings object. + */ + public function setData(array $data) { + $this->data = $data; + return $this; + } + + /** + * Sets value in this theme settings object. + * + * @param string $key + * Identifier to store value in theme settings. + * @param string $value + * Value to associate with identifier. + * + * @return Drupal\Core\Theme\ThemeSettings + * The theme settings object. + */ + public function set($key, $value) { + // The dot/period is a reserved character; it may appear between keys, but + // not within keys. + $parts = explode('.', $key); + if (count($parts) == 1) { + $this->data[$key] = $value; + } + else { + NestedArray::setValue($this->data, $parts, $value); + } + return $this; + } + + /** + * Unsets value in this theme settings object. + * + * @param string $key + * Name of the key whose value should be unset. + * + * @return Drupal\Core\Theme\ThemeSettings + * The theme settings object. + */ + public function clear($key) { + $parts = explode('.', $key); + if (count($parts) == 1) { + unset($this->data[$key]); + } + else { + NestedArray::unsetValue($this->data, $parts); + } + return $this; + } +}