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

This commit is contained in:
Pantheon Automation 2016-01-06 16:31:26 -08:00 committed by Greg Anderson
parent 1a0e9d9fac
commit a6b049dd05
538 changed files with 5247 additions and 1594 deletions

View file

@ -47,12 +47,12 @@ class Registry implements DestructableInterface {
* - name: The name of the extension the original theme hook originates
* from; e.g., 'node' for theme hook 'node' of Node module.
* - theme path: The effective \Drupal\Core\Theme\ActiveTheme::getPath()
* during _theme(), available as
* 'directory' variable in templates. For functions, it should point to
* the respective theme.For templates, it should point to the directory
* that contains the template.
* during \Drupal\Core\Theme\ThemeManagerInterface::render(), available
* as 'directory' variable in templates. For functions, it should point
* to the respective theme. For templates, it should point to the
* directory that contains the template.
* - includes: (optional) An array of include files to load when the theme
* hook is executed by _theme().
* hook is executed by \Drupal\Core\Theme\ThemeManagerInterface::render().
* - file: (optional) A filename to add to 'includes', either prefixed with
* the value of 'path', or the path of the extension implementing
* hook_theme().
@ -389,7 +389,8 @@ class Registry implements DestructableInterface {
* in hook_theme(). If there is more than one implementation and
* 'render element' is not specified in a later one, then the previous
* definition is kept.
* - 'preprocess functions': See _theme() for detailed documentation.
* - See the @link themeable Theme system overview topic @endlink for
* detailed documentation.
* @param string $name
* The name of the module, theme engine, base theme engine, theme or base
* theme implementing hook_theme().
@ -530,7 +531,8 @@ class Registry implements DestructableInterface {
}
foreach ($prefixes as $prefix) {
// Only use non-hook-specific variable preprocessors for theming
// hooks implemented as templates. See _theme().
// hooks implemented as templates. See the @defgroup themeable
// topic.
if (isset($info['template']) && function_exists($prefix . '_preprocess')) {
$info['preprocess functions'][] = $prefix . '_preprocess';
}
@ -566,7 +568,7 @@ class Registry implements DestructableInterface {
$cache[$hook]['preprocess functions'] = array();
}
// Only use non-hook-specific variable preprocessors for theme hooks
// implemented as templates. See _theme().
// implemented as templates. See the @defgroup themeable topic.
if (isset($info['template']) && function_exists($name . '_preprocess')) {
$cache[$hook]['preprocess functions'][] = $name . '_preprocess';
}

View file

@ -267,7 +267,7 @@ class ThemeInitialization implements ThemeInitializationInterface {
*/
protected function getExtensions() {
if (!isset($this->extensions)) {
$this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo());
$this->extensions = array_merge($this->moduleHandler->getModuleList(), $this->themeHandler->listInfo());
}
return $this->extensions;
}

View file

@ -138,11 +138,11 @@ class ThemeManager implements ThemeManagerInterface {
$active_theme = $this->getActiveTheme();
// If called before all modules are loaded, we do not necessarily have a full
// theme registry to work with, and therefore cannot process the theme
// If called before all modules are loaded, we do not necessarily have a
// full theme registry to work with, and therefore cannot process the theme
// request properly. See also \Drupal\Core\Theme\Registry::get().
if (!$this->moduleHandler->isLoaded() && !defined('MAINTENANCE_MODE')) {
throw new \Exception(t('_theme() may not be called until all modules are loaded.'));
throw new \Exception('The theme implementations may not be rendered until all modules are loaded.');
}
$theme_registry = $this->themeRegistry->getRuntime();
@ -180,9 +180,10 @@ class ThemeManager implements ThemeManagerInterface {
\Drupal::logger('theme')->warning('Theme hook %hook not found.', array('%hook' => $hook));
}
// There is no theme implementation for the hook passed. Return FALSE so
// the function calling _theme() can differentiate between a hook that
// exists and renders an empty string and a hook that is not
// implemented.
// the function calling
// \Drupal\Core\Theme\ThemeManagerInterface::render() can differentiate
// between a hook that exists and renders an empty string, and a hook
// that is not implemented.
return FALSE;
}
}
@ -233,8 +234,8 @@ class ThemeManager implements ThemeManagerInterface {
// Invoke hook_theme_suggestions_HOOK().
$suggestions = $this->moduleHandler->invokeAll('theme_suggestions_' . $base_theme_hook, array($variables));
// If _theme() was invoked with a direct theme suggestion like
// '#theme' => 'node__article', add it to the suggestions array before
// If the theme implementation was invoked with a direct theme suggestion
// like '#theme' => 'node__article', add it to the suggestions array before
// invoking suggestion alter hooks.
if (isset($info['base hook'])) {
$suggestions[] = $hook;
@ -250,10 +251,10 @@ class ThemeManager implements ThemeManagerInterface {
$this->alter($hooks, $suggestions, $variables, $base_theme_hook);
// Check if each suggestion exists in the theme registry, and if so,
// use it instead of the hook that _theme() was called with. For example, a
// function may call _theme('node', ...), but a module can add
// 'node__article' as a suggestion via hook_theme_suggestions_HOOK_alter(),
// enabling a theme to have an alternate template file for article nodes.
// use it instead of the base hook. For example, a function may use
// '#theme' => 'node', but a module can add 'node__article' as a suggestion
// via hook_theme_suggestions_HOOK_alter(), enabling a theme to have
// an alternate template file for article nodes.
foreach (array_reverse($suggestions) as $suggestion) {
if ($theme_registry->has($suggestion)) {
$info = $theme_registry->get($suggestion);