From e66d0b7519090a6d1bbe6fedd8b275ad5703643f Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 11 Aug 2009 04:50:36 +0000 Subject: #511760 follow-up by rfay: Improve error messages in file_unmanaged_copy(). --- includes/file.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/file.inc b/includes/file.inc index 73dea894b..d73266cb4 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -692,7 +692,7 @@ function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXIST $destination = file_destination($directory . '/' . $basename, $replace); if ($destination === FALSE) { - drupal_set_message(t('The specified file %file could not be copied because a file by that name already exists in the destination %directory.', array('%file' => $source, '%directory' => $proposed_destination)), 'error'); + drupal_set_message(t('The file %file could not be copied because a file by that name already exists in the destination directory (%directory)', array('%file' => $source, '%directory' => $proposed_destination)), 'error'); return FALSE; } // Make sure source and destination filenames are not the same, makes no @@ -743,7 +743,7 @@ function file_destination($destination, $replace) { break; case FILE_EXISTS_ERROR: - drupal_set_message(t('The specified file %file could not be copied, because a file by that name already exists in the destination.', array('%file' => $destination)), 'error'); + // Error reporting handled by calling function. return FALSE; } } @@ -1187,6 +1187,7 @@ function file_save_upload($source, $validators = array(), $destination = FALSE, // If file_destination() returns FALSE then $replace == FILE_EXISTS_ERROR and // there's an existing file so we need to bail. if ($file->destination === FALSE) { + drupal_set_message(t('The file %source could not be uploaded because a file by that name already exists in the destination %directory.', array('%source' => $source, '%directory' => $destination)), 'error'); return FALSE; } -- cgit v1.2.3