Opened 17 years ago

Closed 17 years ago

#934 closed Bug (fixed)

FCKEditor in modaldialog with plugin

Reported by: Paul Vrugt Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version: FCKeditor 2.4.3
Keywords: Confirmed IE Cc:

Description

Here at Infoland we have a problem using the fckEditor. When using the fckeditor in a modaldialog, we're getting a javascript error when closing the dialog. The error is: "Can't execute code from a freed script".

It seems to be a timing issue since it doesn't occur every time. We've traced the problem to the point where the fckEditor seems to fire an onblur event. The error occurs in FCKFocumManager_FireOnBlur, which calls an anonymous function. Within this anonymous function, the error occurs. But since the code is "compiled", I can't make heads or tails of the code being executed. It's trying to execute a function in an array Called D at position i. So that's not helping. How should I continue to pinpoint the problem and solve it, because we really need this thing to work?

Update:

I've narrowed the problem down quite a bit. I attach an onblur event to the fckeditor in the "FCKeditor_OnComplete" function. This works fine until i load a plugin I created. Once i add the plugin (not even add the toolbarbutton that uses the plugin) the problem occurs. Although the plugin doesn't do anything with onblur events

I've created a testcase to reproduce the problem

Attachments (1)

fckBugTest.zip (8.2 KB) - added by Paul Vrugt 17 years ago.
I've excluded all fckeditor content from the zip package to reduce size. Just copy the fckeditor into the correct folder and leave the fckconfig.js and the attached plugin

Download all attachments as: .zip

Change History (8)

Changed 17 years ago by Paul Vrugt

Attachment: fckBugTest.zip added

I've excluded all fckeditor content from the zip package to reduce size. Just copy the fckeditor into the correct folder and leave the fckconfig.js and the attached plugin

comment:1 Changed 17 years ago by Frederico Caldeira Knabben

You did a great job with the reduced test case. But, I have no problems here. I've tried it with both IE6 and IE7 and no errors have been thrown. Do you have anything online so we can see the problem? Maybe there is something else to be done that we are not aware about.

comment:2 in reply to:  description ; Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Pending added

Replying to paulvrugt:

But since the code is "compiled", I can't make heads or tails of the code being executed.

You should run the editor in _source mode. Check this link for more info on this.

comment:3 in reply to:  2 Changed 17 years ago by Paul Vrugt

Maybe I didn't explain myself clear enough. The problem only occurs when pressing the close button in the modaldialog, which calls window.close() . When just closing the modaldialog when pressing the X in the top right corner, no problems occur.

I retried my testcase:

  • Download the zip from this page, and extracted it to a webfolder
  • Download the latest version of the FCKEditor
  • Copy all files of the fckeditor to the fckeditor folder in the testcase
  • Make sure the fckconfig.js and the plugin was not overwritten.
  • Open the dialog.html page, which opens a modaldialog.
  • Type some text in the editor
  • Press the close button

The problem doesnt occur every time, but it happens most of the time

comment:4 Changed 17 years ago by Paul Vrugt

Great.... The editor removed my linebreaks...In the editor the "step-by-step guide" was a great dashed-list. So just imagine a line-break at every dash :)

comment:5 Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Confirmed IE added; Pending removed

Ok... I was able to reproduce it now. The page must be scrolled down to show the close button, so I was just using the X.

The JS error is thrown always when first placing the cursor in the editor and then clicking on the close button. At that moment the editor looses the focus (onblur) but the dialog closes so quickly that the function is not anymore available. I'll try to find the buggy point in the code.

comment:6 Changed 17 years ago by Paul Vrugt

That's good news.

Remember: somehow, the error doesnt occur when disabling to customdialog plugin in the fckconfig.js

comment:7 Changed 17 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.5
Resolution: fixed
Status: newclosed

Fixed with [409].

Click here for more info about our SVN system.

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