Opened 9 years ago

Closed 9 years ago

#1693 closed Bug (fixed)

Filemanager not returning error message (Javascript)

Reported by: redtopia Owned by: wwalc
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 wwalc 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by wwalc

comment:1 Changed 9 years ago by wwalc

  • Keywords Confirmed Review? added
  • Milestone set to FCKeditor 2.6
  • Owner set to wwalc

comment:2 Changed 9 years ago by fredck

  • Keywords Review+ added; Review? removed

Please include the changelog on commit.

comment:3 Changed 9 years ago by wwalc

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [1566].

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy