Updated: Comment #N
Problem/Motivation
In order to not stall #2167347: It's possible to enable a non-existing theme so people can write sub themes this issue addresses the code rewrites for using the new function.
Proposed resolution
Replace code calling config() directly like found with
$ grep -ri \'admin\' * | grep -i theme
edit/edit.module: $theme = Drupal::config('system.theme')->get('admin');
shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php: \Drupal::config('system.theme')->set('admin', 'seven')->save();
system/lib/Drupal/system/Controller/SystemController.php: $admin_theme = $config->get('admin');
system/lib/Drupal/system/Controller/ThemeController.php: if ($theme === $this->config->get('default') || $theme === $this->config->get('admin')) {
system/lib/Drupal/system/Form/ThemeAdminForm.php: '#default_value' => $this->config('system.theme')->get('admin'),
system/lib/Drupal/system/Form/ThemeAdminForm.php: $this->config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save();
system/lib/Drupal/system/Tests/Batch/PageTest.php: \Drupal::config('system.theme')->set('admin', 'seven')->save();
system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php: 'theme' => \Drupal::config('system.theme')->get('admin'),
system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php: ->set('admin', $this->admin_theme)
system/lib/Drupal/system/Tests/System/ThemeTest.php: $this->drupalGet('admin');
system/system.admin.inc: $admin_theme = \Drupal::config('system.theme')->get('admin');
system/system.install: 'admin_theme' => 'admin',
system/tests/modules/menu_test/lib/Drupal/menu_test/Theme/TestThemeNegotiator.php: return \Drupal::config('system.theme')->get('admin');
taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php: ->set('admin', 'seven')
user/lib/Drupal/user/Theme/AdminNegotiator.php: return $this->configFactory->get('system.theme')->get('admin');
Other scans
$ grep -ir "get('system.theme'" *
$ grep -ri \'default\' * | grep -i theme
Remaining tasks
Find more parts using config() calls for default theme.
User interface changes
API changes
Comments
Comment #1
clemens.tolboomFixed grep command and added 2 more.
Comment #2
star-szrBumping, I think this could be worked on in later 8.x.x versions.
Comment #3
joelpittetDoesn't need to be postponed any longer, can be tackled in 8.1.x as the branches are synced
Comment #4
dawehnerYeah taht sounds sensible!
Comment #17
catch#2176355: Followup: rewrite remaining code to use themehandler get|set|is for default and admin didn't land, we did #1067408: Themes do not have an installation status, but that issue didn't add the set/get/is methods mentioned here, so closing this as outdated.