X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FForm%2FThemeSettingsForm.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FForm%2FThemeSettingsForm.php;h=2ad98931a3e6377ca51c772b0f04c277feb15f4c;hp=f5cfb090826095502702deace675154248c0642b;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/system/src/Form/ThemeSettingsForm.php b/web/core/modules/system/src/Form/ThemeSettingsForm.php index f5cfb0908..2ad98931a 100644 --- a/web/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/web/core/modules/system/src/Form/ThemeSettingsForm.php @@ -324,9 +324,21 @@ class ThemeSettingsForm extends ConfigFormBase { // Process the theme and all its base themes. foreach ($theme_keys as $theme) { // Include the theme-settings.php file. - $filename = DRUPAL_ROOT . '/' . $themes[$theme]->getPath() . '/theme-settings.php'; - if (file_exists($filename)) { - require_once $filename; + $theme_path = drupal_get_path('theme', $theme); + $theme_settings_file = $theme_path . '/theme-settings.php'; + $theme_file = $theme_path . '/' . $theme . '.theme'; + $filenames = [$theme_settings_file, $theme_file]; + foreach ($filenames as $filename) { + if (file_exists($filename)) { + require_once $filename; + + // The file must be required for the cached form too. + $files = $form_state->getBuildInfo()['files']; + if (!in_array($filename, $files)) { + $files[] = $filename; + } + $form_state->addBuildInfo('files', $files); + } } // Call theme-specific settings.