diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 15af628..9ae8bcd 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -686,34 +686,36 @@ function system_theme_settings_submit($form, &$form_state) { $values = $form_state['values']; - // If the user uploaded a new logo or favicon, save it to a permanent location - // and use it in place of the default theme-provided file. - if ($file = $values['logo_upload']) { - unset($values['logo_upload']); - $filename = file_unmanaged_copy($file->uri); - $values['default_logo'] = 0; - $values['logo_path'] = $filename; - $values['toggle_logo'] = 1; - } - if ($file = $values['favicon_upload']) { - unset($values['favicon_upload']); - $filename = file_unmanaged_copy($file->uri); - $values['default_favicon'] = 0; - $values['favicon_path'] = $filename; - $values['toggle_favicon'] = 1; - } - - // If the user entered a path relative to the system files directory for - // a logo or favicon, store a public:// URI so the theme system can handle it. - if (!empty($values['logo_path'])) { - $values['logo_path'] = _system_theme_settings_validate_path($values['logo_path']); - } - if (!empty($values['favicon_path'])) { - $values['favicon_path'] = _system_theme_settings_validate_path($values['favicon_path']); - } - - if (empty($values['default_favicon']) && !empty($values['favicon_path'])) { - $values['favicon_mimetype'] = file_get_mimetype($values['favicon_path']); + if (module_exists('file')) { + // If the user uploaded a new logo or favicon, save it to a permanent location + // and use it in place of the default theme-provided file. + if ($file = $values['logo_upload']) { + unset($values['logo_upload']); + $filename = file_unmanaged_copy($file->uri); + $values['default_logo'] = 0; + $values['logo_path'] = $filename; + $values['toggle_logo'] = 1; + } + if ($file = $values['favicon_upload']) { + unset($values['favicon_upload']); + $filename = file_unmanaged_copy($file->uri); + $values['default_favicon'] = 0; + $values['favicon_path'] = $filename; + $values['toggle_favicon'] = 1; + } + + // If the user entered a path relative to the system files directory for + // a logo or favicon, store a public:// URI so the theme system can handle it. + if (!empty($values['logo_path'])) { + $values['logo_path'] = _system_theme_settings_validate_path($values['logo_path']); + } + if (!empty($values['favicon_path'])) { + $values['favicon_path'] = _system_theme_settings_validate_path($values['favicon_path']); + } + + if (empty($values['default_favicon']) && !empty($values['favicon_path'])) { + $values['favicon_mimetype'] = file_get_mimetype($values['favicon_path']); + } } variable_set($key, $values); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php index 58fdf6b..43f43e3 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php @@ -77,6 +77,8 @@ class UserPermissionsTest extends WebTestBase { // permission is assigned by default. $edit = array(); $edit['modules[Core][aggregator][enable]'] = TRUE; + // Aggregator depends on file module, enable that as well. + $edit['modules[Core][file][enable]'] = TRUE; $this->drupalPost('admin/modules', $edit, t('Save configuration')); $this->assertTrue(user_access('administer news feeds', $this->admin_user), t('The permission was automatically assigned to the administrator role')); }