diff --git a/l10n_packager/l10n_packager.inc b/l10n_packager/l10n_packager.inc index 4e1e3a2..b87af18 100644 --- a/l10n_packager/l10n_packager.inc +++ b/l10n_packager/l10n_packager.inc @@ -241,16 +241,16 @@ function l10n_packager_create_latest_symlink($file, $release, $language) { $target = drupal_realpath($file); $target_dir = dirname($target); $latest_file = $target_dir . '/' . l10n_packager_get_filepath($release, $language, '%project-%branch.%language.po'); + if (file_exists($latest_file)) { unlink($latest_file); - // Allow modules to react to the symlink, such as purge a CDN. - $file = new stdClass(); - $file->uri = $latest_file; - module_invoke_all('l10n_packager_done', $file); + $latest_file_object = new stdClass(); + $latest_file_object->uri = $latest_file; + module_invoke_all('l10n_packager_done', $latest_file_object); } - return symlink($target, $latest_file); + return symlink($target, $latest_file); } // == Utility functions ========================================================