Applied adapted Drupal core patch #572516 for sites with mixed public and private files

This commit is contained in:
Manuel Cillero 2017-08-20 17:26:27 +02:00
parent 75c72c4cbb
commit 5c5aaddc78
6 changed files with 35 additions and 27 deletions

View file

@ -1391,11 +1391,11 @@ function system_performance_settings() {
$form['bandwidth_optimizations'] = array(
'#type' => 'fieldset',
'#title' => t('Bandwidth optimizations'),
'#description' => t('<p>Drupal can automatically optimize external resources like CSS and JavaScript, which can reduce both the size and number of requests made to your website. CSS files can be aggregated and compressed into a single file, while JavaScript files are aggregated (but not compressed). These optional optimizations may reduce server load, bandwidth requirements, and page loading times.</p><p>These options are disabled if you have not set up your files directory, or if your download method is set to private.</p>')
'#description' => t('<p>Drupal can automatically optimize external resources like CSS and JavaScript, which can reduce both the size and number of requests made to your website. CSS files can be aggregated and compressed into a single file, while JavaScript files are aggregated (but not compressed). These optional optimizations may reduce server load, bandwidth requirements, and page loading times.</p><p>These options are disabled if you have not set up your files directory, or if your download method is set to private and directory %public_files does not exists or isn\'t writable.</p>', array('%public_files' => variable_get('file_dirpublic_path', 'files')))
);
$directory = file_directory_path();
$is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
$directory = file_directory_path(0, TRUE);
$is_writable = is_dir($directory) && is_writable($directory);
$form['bandwidth_optimizations']['preprocess_css'] = array(
'#type' => 'radios',
'#title' => t('Optimize CSS files'),