Opened 17 years ago
Closed 17 years ago
#1693 closed Bug (fixed)
Filemanager not returning error message (Javascript)
Reported by: | John Pansewicz | Owned by: | Wiktor Walc |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.6 |
Component: | File Browser | Version: | FCKeditor 2.5 |
Keywords: | Confirmed Review+ | Cc: |
Description
I was having a problem with ColdFusions server not returning a valid temp directory when uploading a file. A empty Javascript alert popped up telling me nothing. After some debugging, I found that the message that was generated from a coldfusion exception was not being passed through to the function OnUploadCompleted () in the file: filemanager/browser/default/frmupload.html.
To reproduce:
Edit the file: filemanager\browser\default\connectors\cfm\cf_commands.cfm
Delete destination="#GetTempDirectory()#" from the cffile call. Replace it with an empty string. This will give you an invalid directory, and an exception will be thrown.
Try uploading a file into the file manager browser. A blank alert will appear.
The Fix:
The file filemanager/browser/default/browser.html has a function in it:
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
This function accepts a customMsg that contains the message from an exception in the connector script. This message is not being passed to the function (with the same name) that it calls. You need to pass customMsg to the OnUploadCompleted in the file upload frame, as follows:
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) {
window.framesfrmUpload?.OnUploadCompleted( errorNumber, fileName, customMsg ) ;
}
Then you need to modify the called function to accept the new parameter.
In the file:
file filemanager/browser/default/frmupload.html
add the paramter to the end of the param list:
function OnUploadCompleted( errorNumber, data, customMsg )
Then use it to display in the alert for error number 1:
switch ( errorNumber ) {
case 0 :
window.parent.framesfrmResourcesList?.Refresh() ; break ;
case 1 : Custom error.
alert( customMsg ) ; break ;
Attachments (1)
Change History (4)
Changed 17 years ago by
Attachment: | browser_OnUploadCompleted.patch added |
---|
comment:1 Changed 17 years ago by
Keywords: | Confirmed Review? added |
---|---|
Milestone: | → FCKeditor 2.6 |
Owner: | set to Wiktor Walc |
comment:2 Changed 17 years ago by
Keywords: | Review+ added; Review? removed |
---|
Please include the changelog on commit.