diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php index ddb4e92..fe8f196 100644 --- a/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -324,8 +324,9 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme = // Process the theme and all its base themes. foreach ($theme_keys as $theme) { // Include the theme-settings.php file. - $theme_settings_file = drupal_get_path('theme', $theme) . '/theme-settings.php'; - $theme_file = drupal_get_path('theme', $theme) . '/' . $theme . '.theme'; + $theme_path = drupal_get_path('theme', $theme); + $theme_settings_file = $theme_path . '/theme-settings.php'; + $theme_file = $theme_path . '/' . $theme . '.theme'; $filenames = array($theme_settings_file, $theme_file); foreach ($filenames as $filename) { if (file_exists($filename)) { diff --git a/core/modules/system/src/Tests/Theme/ThemeTestCustomSettings.php b/core/modules/system/src/Tests/Theme/ThemeTestCustomSettings.php index 6cd41d0..c721eba 100644 --- a/core/modules/system/src/Tests/Theme/ThemeTestCustomSettings.php +++ b/core/modules/system/src/Tests/Theme/ThemeTestCustomSettings.php @@ -64,7 +64,7 @@ protected function getLastFileId() { public function testCustomThemeSettings() { $themes = ['test_theme', 'test_theme_alter']; - foreach ($themes AS $theme) { + foreach ($themes as $theme) { $this->config('system.theme') ->set('default', $theme) ->save(); diff --git a/core/modules/system/tests/themes/test_theme/test_theme.theme b/core/modules/system/tests/themes/test_theme/test_theme.theme index bf980a1..0ab2317 100644 --- a/core/modules/system/tests/themes/test_theme/test_theme.theme +++ b/core/modules/system/tests/themes/test_theme/test_theme.theme @@ -1,5 +1,8 @@ getValue('custom_logo')) { - $element = $form_state->getValue('custom_logo'); +function test_theme_form_system_theme_settings_submit(&$form, FormStateInterface $form_state) { + if ($form_state->getValue(['custom_logo', '0'])) { + $element = $form_state->getValue(['custom_logo', '0']); if (!empty($element[0])){ // Make submited files permanent. - $file = \Drupal\file\Entity\File::load($element[0]); + $file = File::load($element[0]); $file->setPermanent(); $file->save(); } diff --git a/core/modules/system/tests/themes/test_theme_alter/test_theme_alter.theme b/core/modules/system/tests/themes/test_theme_alter/test_theme_alter.theme deleted file mode 100644 index 04628c8..0000000 --- a/core/modules/system/tests/themes/test_theme_alter/test_theme_alter.theme +++ /dev/null @@ -1,12 +0,0 @@ -