Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Theme\MissingThemeDependencyException.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Theme;
|
||||
|
||||
/**
|
||||
* Exception to be thrown when base theme for installed theme is not installed.
|
||||
*
|
||||
* @see \Drupal\Core\Theme\ThemeInitialization::getActiveThemeByName().
|
||||
*/
|
||||
class MissingThemeDependencyException extends \Exception {
|
||||
|
||||
/**
|
||||
* The missing theme dependency.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $theme;
|
||||
|
||||
/**
|
||||
* Constructs the exception.
|
||||
*
|
||||
* @param string $message
|
||||
* The exception message.
|
||||
* @param string $theme
|
||||
* The missing theme dependency.
|
||||
*/
|
||||
public function __construct($message, $theme) {
|
||||
parent::__construct($message);
|
||||
$this->theme = $theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the machine name of the missing theme.
|
||||
*
|
||||
* @return string
|
||||
* The machine name of the theme that is missing.
|
||||
*/
|
||||
public function getMissingThemeName() {
|
||||
return $this->theme;
|
||||
}
|
||||
|
||||
}
|
|
@ -109,6 +109,16 @@ class ThemeInitialization implements ThemeInitializationInterface {
|
|||
$ancestor = $theme_name;
|
||||
while ($ancestor && isset($themes[$ancestor]->base_theme)) {
|
||||
$ancestor = $themes[$ancestor]->base_theme;
|
||||
if (!$this->themeHandler->themeExists($ancestor)) {
|
||||
if ($ancestor == 'stable') {
|
||||
// Themes that depend on Stable will be fixed by system_update_8014().
|
||||
// There is no harm in not adding it as an ancestor since at worst
|
||||
// some people might experience slight visual regressions on
|
||||
// update.php.
|
||||
continue;
|
||||
}
|
||||
throw new MissingThemeDependencyException(sprintf('Base theme %s has not been installed.', $ancestor), $ancestor);
|
||||
}
|
||||
$base_themes[] = $themes[$ancestor];
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@ interface ThemeInitializationInterface {
|
|||
*
|
||||
* @return \Drupal\Core\Theme\ActiveTheme
|
||||
* An active theme object instance for the given theme.
|
||||
*
|
||||
* @throws \Drupal\Core\Theme\MissingThemeDependencyException
|
||||
* Thrown when base theme for installed theme is not installed.
|
||||
*/
|
||||
public function getActiveThemeByName($theme_name);
|
||||
|
||||
|
@ -54,8 +57,8 @@ interface ThemeInitializationInterface {
|
|||
* @param \Drupal\Core\Extension\Extension $theme
|
||||
* The theme extension object.
|
||||
* @param \Drupal\Core\Extension\Extension[] $base_themes
|
||||
* An array of extension objects of base theme and its bases. It is ordered
|
||||
* by 'oldest first', meaning the top level of the chain will be first.
|
||||
* An array of extension objects of base theme and its bases. It is ordered
|
||||
* by 'next parent first', meaning the top level of the chain will be first.
|
||||
*
|
||||
* @return \Drupal\Core\Theme\ActiveTheme
|
||||
* The active theme instance for the passed in $theme.
|
||||
|
|
Reference in a new issue