diff --git a/core/modules/file/file.info b/core/modules/file/file.info index 213c5ba..dc93ab0 100644 --- a/core/modules/file/file.info +++ b/core/modules/file/file.info @@ -4,4 +4,3 @@ package = Core version = VERSION core = 8.x dependencies[] = field -required = TRUE diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php index 30d8422..dd9f28e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -22,7 +22,7 @@ class ThemeTest extends WebTestBase { } function setUp() { - parent::setUp(array('node', 'block')); + parent::setUp(array('node', 'block', 'file')); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index de17cef..9e9f5a6 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -427,8 +427,8 @@ function system_theme_settings($form, &$form_state, $key = '') { $form['theme_settings']['#access'] = FALSE; } - // Logo settings - if ((!$key) || in_array('logo', $features)) { + // Logo settings, only available when file.module is enabled. + if ((!$key) || in_array('logo', $features) && module_exists('file')) { $form['logo'] = array( '#type' => 'fieldset', '#title' => t('Logo image settings'), @@ -462,7 +462,7 @@ function system_theme_settings($form, &$form_state, $key = '') { ); } - if ((!$key) || in_array('favicon', $features)) { + if ((!$key) || in_array('favicon', $features) && module_exists('file')) { $form['favicon'] = array( '#type' => 'fieldset', '#title' => t('Shortcut icon settings'), @@ -591,51 +591,53 @@ function system_theme_settings($form, &$form_state, $key = '') { * Validator for the system_theme_settings() form. */ function system_theme_settings_validate($form, &$form_state) { - // Handle file uploads. - $validators = array('file_validate_is_image' => array()); - - // Check for a new uploaded logo. - $file = file_save_upload('logo_upload', $validators); - if (isset($file)) { - // File upload was attempted. - if ($file) { - // Put the temporary file in form_values so we can save it on submit. - $form_state['values']['logo_upload'] = $file; - } - else { - // File upload failed. - form_set_error('logo_upload', t('The logo could not be uploaded.')); + if (module_exists('file')) { + // Handle file uploads. + $validators = array('file_validate_is_image' => array()); + + // Check for a new uploaded logo. + $file = file_save_upload('logo_upload', $validators); + if (isset($file)) { + // File upload was attempted. + if ($file) { + // Put the temporary file in form_values so we can save it on submit. + $form_state['values']['logo_upload'] = $file; + } + else { + // File upload failed. + form_set_error('logo_upload', t('The logo could not be uploaded.')); + } } - } - $validators = array('file_validate_extensions' => array('ico png gif jpg jpeg apng svg')); + $validators = array('file_validate_extensions' => array('ico png gif jpg jpeg apng svg')); - // Check for a new uploaded favicon. - $file = file_save_upload('favicon_upload', $validators); - if (isset($file)) { - // File upload was attempted. - if ($file) { - // Put the temporary file in form_values so we can save it on submit. - $form_state['values']['favicon_upload'] = $file; - } - else { - // File upload failed. - form_set_error('favicon_upload', t('The favicon could not be uploaded.')); + // Check for a new uploaded favicon. + $file = file_save_upload('favicon_upload', $validators); + if (isset($file)) { + // File upload was attempted. + if ($file) { + // Put the temporary file in form_values so we can save it on submit. + $form_state['values']['favicon_upload'] = $file; + } + else { + // File upload failed. + form_set_error('favicon_upload', t('The favicon could not be uploaded.')); + } } - } - // If the user provided a path for a logo or favicon file, make sure a file - // exists at that path. - if ($form_state['values']['logo_path']) { - $path = _system_theme_settings_validate_path($form_state['values']['logo_path']); - if (!$path) { - form_set_error('logo_path', t('The custom logo path is invalid.')); + // If the user provided a path for a logo or favicon file, make sure a file + // exists at that path. + if ($form_state['values']['logo_path']) { + $path = _system_theme_settings_validate_path($form_state['values']['logo_path']); + if (!$path) { + form_set_error('logo_path', t('The custom logo path is invalid.')); + } } - } - if ($form_state['values']['favicon_path']) { - $path = _system_theme_settings_validate_path($form_state['values']['favicon_path']); - if (!$path) { - form_set_error('favicon_path', t('The custom favicon path is invalid.')); + if ($form_state['values']['favicon_path']) { + $path = _system_theme_settings_validate_path($form_state['values']['favicon_path']); + if (!$path) { + form_set_error('favicon_path', t('The custom favicon path is invalid.')); + } } } } diff --git a/core/modules/update/update.info b/core/modules/update/update.info index 0dfda0a..2fb657e 100644 --- a/core/modules/update/update.info +++ b/core/modules/update/update.info @@ -4,3 +4,4 @@ version = VERSION package = Core core = 8.x configure = admin/reports/updates/settings +dependencies[]=file