Applied adapted Drupal core patch #572516 for sites with mixed public and private files
This commit is contained in:
parent
75c72c4cbb
commit
5c5aaddc78
6 changed files with 35 additions and 27 deletions
|
@ -2181,7 +2181,7 @@ function _locale_rebuild_js($langcode = NULL) {
|
|||
|
||||
// Construct the filepath where JS translation files are stored.
|
||||
// There is (on purpose) no front end to edit that variable.
|
||||
$dir = file_create_path(variable_get('locale_js_directory', 'languages'));
|
||||
$dir = file_create_path(variable_get('locale_js_directory', 'languages'), TRUE);
|
||||
|
||||
// Delete old file, if we have no translations anymore, or a different file to be saved.
|
||||
$changed_hash = $language->javascript != $data_hash;
|
||||
|
@ -2199,7 +2199,7 @@ function _locale_rebuild_js($langcode = NULL) {
|
|||
file_check_directory($dir, TRUE);
|
||||
|
||||
// Save the file.
|
||||
if (file_save_data($data, $dest)) {
|
||||
if (file_save_data($data, $dest, FILE_EXISTS_REPLACE, TRUE)) {
|
||||
$language->javascript = $data_hash;
|
||||
// If we deleted a previous version of the file and we replace it with a
|
||||
// new one we have an update.
|
||||
|
|
Reference in a new issue