Opened 16 years ago

Closed 16 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)

browser_OnUploadCompleted.patch (544 bytes) - added by Wiktor Walc 16 years ago.

Download all attachments as: .zip

Change History (4)

Changed 16 years ago by Wiktor Walc

comment:1 Changed 16 years ago by Wiktor Walc

Keywords: Confirmed Review? added
Milestone: FCKeditor 2.6
Owner: set to Wiktor Walc

comment:2 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

Please include the changelog on commit.

comment:3 Changed 16 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [1566].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy