This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Directory creation error #4244
Merged
jasonsanjose
merged 10 commits into
adobe:master
from
thefirstofthe300:directory-creation-error
Jul 11, 2013
Merged
Directory creation error #4244
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
53ed7ee
Fixed directory already exists issue
thefirstofthe300 33e01f3
Merge branch 'duplicate-directory-dialog-fix' into directory-creation…
thefirstofthe300 6731218
Implemented code review suggestions
thefirstofthe300 29cd68d
Finished code review fixes
thefirstofthe300 e17c0a7
Added variables to strings
thefirstofthe300 de84314
Merge branch 'master' into directory-creation-error
thefirstofthe300 988e637
Removed Directory_Already_Exists and adopted comments
thefirstofthe300 0f26eba
Implemented more comments
thefirstofthe300 b87a928
Fixed typo that broke error_cleanup
thefirstofthe300 ca269fa
Implemented final comments (I hope)
thefirstofthe300 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1227,15 +1227,14 @@ define(function (require, exports, module) { | |
}; | ||
|
||
var errorCallback = function (error) { | ||
var entryType = isFolder ? Strings.DIRECTORY : Strings.FILE; | ||
if ((error.name === NativeFileError.PATH_EXISTS_ERR) || | ||
(error.name === NativeFileError.TYPE_MISMATCH_ERR)) { | ||
Dialogs.showModalDialog( | ||
DefaultDialogs.DIALOG_ID_ERROR, | ||
Strings.INVALID_FILENAME_TITLE, | ||
StringUtils.format( | ||
Strings.FILE_ALREADY_EXISTS, | ||
StringUtils.breakableUrl(data.rslt.name) | ||
) | ||
StringUtils.format(Strings.INVALID_FILENAME_TITLE, entryType), | ||
StringUtils.format(Strings.FILE_ALREADY_EXISTS, entryType, | ||
StringUtils.breakableUrl(data.rslt.name)) | ||
); | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this else branch there is another error dialog that always display "File" in the strings as the code fixed. Maybe this could be fixed here too. |
||
var errString = error.name === NativeFileError.NO_MODIFICATION_ALLOWED_ERR ? | ||
|
@@ -1244,12 +1243,9 @@ define(function (require, exports, module) { | |
|
||
Dialogs.showModalDialog( | ||
DefaultDialogs.DIALOG_ID_ERROR, | ||
Strings.ERROR_CREATING_FILE_TITLE, | ||
StringUtils.format( | ||
Strings.ERROR_CREATING_FILE, | ||
StringUtils.breakableUrl(data.rslt.name), | ||
errString | ||
) | ||
StringUtils.format(Strings.ERROR_CREATING_FILE_TITLE, entryType), | ||
StringUtils.format(Strings.ERROR_CREATING_FILE, entryType, | ||
Strings.breakableUrl(data.rslt.name), errString) | ||
); | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost. I went back to the original bug to test and found some more issues not mentioned.
If you create a file with a name
foo
, the try to create a directory of the same name, you get "The directory foo already exists" instead of "The file foo already exists"...and vice versa.You can split the
if
here with anelse if
branch to handleTYPE_MISMATCH_ERR
separate fromPATH_EXISTS_ERROR
, that should fix it.