diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-11 04:50:36 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-11 04:50:36 +0000 |
commit | e66d0b7519090a6d1bbe6fedd8b275ad5703643f (patch) | |
tree | bbb8ac94e42edd6ce5e9a79f44ae8793568a2a00 /includes | |
parent | 1a251a74791150cfbea9a229bf60e19d8f683deb (diff) | |
download | brdo-e66d0b7519090a6d1bbe6fedd8b275ad5703643f.tar.gz brdo-e66d0b7519090a6d1bbe6fedd8b275ad5703643f.tar.bz2 |
#511760 follow-up by rfay: Improve error messages in file_unmanaged_copy().
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |