-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Directory creation error #4244
Directory creation error #4244
Changes from 2 commits
53ed7ee
33e01f3
6731218
29cd68d
e17c0a7
de84314
988e637
0f26eba
b87a928
ca269fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,8 +56,10 @@ define({ | |
| "ERROR_DELETING_FILE_TITLE" : "Error deleting file", | ||
| "ERROR_DELETING_FILE" : "An error occurred when trying to delete the file <span class='dialog-filename'>{0}</span>. {1}", | ||
| "INVALID_FILENAME_TITLE" : "Invalid file name", | ||
| "INVALID_DIRECTORYNAME_TITLE" : "Invalid directory name", | ||
| "INVALID_FILENAME_MESSAGE" : "Filenames cannot contain the following characters: /?*:;{}<>\\| or use any system reserved words.", | ||
| "FILE_ALREADY_EXISTS" : "The file <span class='dialog-filename'>{0}</span> already exists.", | ||
| "DIRECTORY_ALREADY_EXISTS" : "The directory <span class='dialog-filename'>{0}</span> already exists.", | ||
|
Member
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. You probably intended to remove |
||
| "ERROR_CREATING_FILE_TITLE" : "Error creating file", | ||
| "ERROR_CREATING_FILE" : "An error occurred when trying to create the file <span class='dialog-filename'>{0}</span>. {1}", | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1255,14 +1255,25 @@ define(function (require, exports, module) { | |
| var errorCallback = function (error) { | ||
| if ((error.name === NativeFileError.PATH_EXISTS_ERR) || | ||
| (error.name === NativeFileError.TYPE_MISMATCH_ERR)) { | ||
|
Member
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. 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 You can split the |
||
| Dialogs.showModalDialog( | ||
| DefaultDialogs.DIALOG_ID_ERROR, | ||
| Strings.INVALID_FILENAME_TITLE, | ||
| StringUtils.format( | ||
| Strings.FILE_ALREADY_EXISTS, | ||
| StringUtils.breakableUrl(data.rslt.name) | ||
| ) | ||
| ); | ||
| if (selectionEntry.isFile) { | ||
|
Member
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. Remove this if statement new if statement and just use suggestions above. |
||
| Dialogs.showModalDialog( | ||
| DefaultDialogs.DIALOG_ID_ERROR, | ||
| Strings.INVALID_FILENAME_TITLE, | ||
| StringUtils.format( | ||
| Strings.FILE_ALREADY_EXISTS, | ||
| StringUtils.breakableUrl(data.rslt.name) | ||
| ) | ||
| ); | ||
| } else { | ||
| Dialogs.showModalDialog( | ||
| DefaultDialogs.DIALOG_ID_ERROR, | ||
| Strings.INVALID_DIRECTORYNAME_TITLE, | ||
| StringUtils.format( | ||
| Strings.DIRECTORY_ALREADY_EXISTS, | ||
| StringUtils.breakableUrl(data.rslt.name) | ||
| ) | ||
| ); | ||
| } | ||
| } else { | ||
|
Contributor
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 ? | ||
| Strings.NO_MODIFICATION_ALLOWED_ERR : | ||
|
|
||
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.
Can't we just change the 2 strings
INVALID_FILENAME_TITLEandFILE_AREADY_EXISTSto take a parameter? e.g.We would probably want to tackle the
ERROR_DELETING_FILEmessage as well in the same way.