diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index 5c69d52..936fbcd 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -1752,73 +1752,6 @@ public function buildOptionsForm(&$form, &$form_state) { case 'analyze-theme': $this->getThemeInformation(); $form['#title'] .= t('Theming information'); - if ($theme = \Drupal::request()->request->get('theme')) { - $this->theme = $theme; - } - elseif (empty($this->theme)) { - $this->theme = \Drupal::config('system.theme')->get('default'); - } - - if (isset($GLOBALS['theme']) && $GLOBALS['theme'] == $this->theme) { - $this->theme_registry = theme_get_registry(); - $theme_engine = $GLOBALS['theme_engine']; - } - else { - $themes = list_themes(); - $theme = $themes[$this->theme]; - - // Find all our ancestor themes and put them in an array. - $base_theme = array(); - $ancestor = $this->theme; - while ($ancestor && isset($themes[$ancestor]->base_theme)) { - $ancestor = $themes[$ancestor]->base_theme; - $base_theme[] = $themes[$ancestor]; - } - - // The base themes should be initialized in the right order. - $base_theme = array_reverse($base_theme); - - // This code is copied directly from _drupal_theme_initialize() - $theme_engine = NULL; - - // Initialize the theme. - if (isset($theme->engine)) { - // Include the engine. - include_once DRUPAL_ROOT . '/' . $theme->owner; - - $theme_engine = $theme->engine; - if (function_exists($theme_engine . '_init')) { - foreach ($base_theme as $base) { - call_user_func($theme_engine . '_init', $base); - } - call_user_func($theme_engine . '_init', $theme); - } - } - else { - // include non-engine theme files - foreach ($base_theme as $base) { - // Include the theme file or the engine. - if (!empty($base->owner)) { - include_once DRUPAL_ROOT . '/' . $base->owner; - } - } - // and our theme gets one too. - if (!empty($theme->owner)) { - include_once DRUPAL_ROOT . '/' . $theme->owner; - } - } - $this->theme_registry = _theme_load_registry($theme, $base_theme, $theme_engine); - } - - // If there's a theme engine involved, we also need to know its extension - // so we can give the proper filename. - $this->theme_extension = '.html.twig'; - if (isset($theme_engine)) { - $extension_function = $theme_engine . '_extension'; - if (function_exists($extension_function)) { - $this->theme_extension = $extension_function(); - } - } $funcs = array(); // Get theme functions for the display. Note that some displays may @@ -2861,11 +2794,11 @@ protected function mergeHandler($type) { * Gets information about the current theme or a specific theme. */ protected function getThemeInformation() { - if ($theme = drupal_container()->get('request')->request->get('theme')) { + if ($theme = \Drupal::request()->request->get('theme')) { $this->theme = $theme; } elseif (empty($this->theme)) { - $this->theme = config('system.theme')->get('default'); + $this->theme = \Drupal::config('system.theme')->get('default'); } if (isset($GLOBALS['theme']) && $GLOBALS['theme'] == $this->theme) {